I am currently studying for the SCJP certification using the Sierra and Bates Study Guide and in many of the self tests (mock exam questions) I keep running into the same problem - I can't tell whether a particular error will be at runtime (an exception) or at compile (compile error). I know this is a bit of a vague question and that it might not be possible to answer but, how can I tell if an error will be found at compile or at runtime? Would you be able to send me some website links that might be able to help me?
Compile time error - the java compiler can't compile the code, often because of syntax errors. Typical candidates:
Runtime error - the code did compile, can be executed but crashes at some point, like you have a division by zero.
null
(may cause NullPointerException)('Crashes' is really not the correct term and is only used to illustrate what happens)