Explain the difference between syntax errors and exceptions
Explain the difference between syntax errors and exceptions. For which would the debugger be useful and why?
Solution
Syntax errors:
Errors where the compiler finds something incorrect with your program and you cannot try to execute it.
Example: incorrect punctuation or may be annoying to use a variable that not be declared.
Syntax errors are the simple to find and correct. The compiler will inform you where it got into problem and its finest guess as to what you did wrong.
EXCEPTION:
Is a problem that arises through the execution of a program when an Exception occur the usual flow of the program is disrupt and the program terminates abnormally which is not optional.
Error is useful because if there is any exception is occurring we cannot provide solution for it and the program should be abnormally terminated. But when error is occurring compilers shows an error message so we can easily resolve it.

