Compile time error vs Run-time error
Compile time error
Compile time error is any type of error that prevents a java program from compiling, e.g.,
- syntax error
- class not found
- a bad file name for the defined class
- a possible loss of precision when you are mixing different java data types
Compiling errors are good, because they allow us to fix our code.
Run-time error happens, while the program is running.
Run-time errors are bad because they crash our program and we don’t always catch them before it is too late.