Logic error: A mistake in the underlying algorithm for a program.
(The compiler cannot detect these errors, and no error message is generated after compilation or execution, but the program does not do what it is supposed to do)
Run-time error: An error that is not detected until a program is run. (The compiler cannot detect these errors: an error message is not generated after compilation, but after execution)
Syntax Error: A grammatical mistake in a program (The compiler can detect these errors, and will output an error message saying what it thinks the error is, and where it thinks the error is)
“local variable may not have been initialized”
This error occurs when setting a variable inside a conditional statement. If the condition is not met the variable would not be assigned a value. Ensure the variable has a value for each condition.