Presentation is loading. Please wait.

Presentation is loading. Please wait.

ERRORS. Types of errors: Syntax errors Logical errors.

Similar presentations


Presentation on theme: "ERRORS. Types of errors: Syntax errors Logical errors."— Presentation transcript:

1 ERRORS

2 Types of errors: Syntax errors Logical errors

3 Syntax errors: In English, a mistake in the grammar rules of the language In Java, is a mistake in the rules of the language Is detected by Java compiler. A program that contains a syntax error will not be compiled. Are called compile-time errors

4 Logical errors: The program can be compiled but, when we attempt to run the program, it doesn’t perform the intended task. To deal with logical statement, you have to debug the program. - print statements - Dr. Java Debugger.

5 Example of a logical error Which statement is a logic error? a) Omitting the ; from the end of the sentence. b) Using the less than ( ) operator was intended. c) Typing STATIC instead of static for the random function d) Misspelling the name of a variable in the program.


Download ppt "ERRORS. Types of errors: Syntax errors Logical errors."

Similar presentations


Ads by Google