M Srilatha wrote:Hi,
Compile time errors(not exceptions) will come due to incorrect syntax.
Runtime Exceptions will be thrown if the usage is wrong at runtime like invoking a null object.
First we should know the correct syntax so that we would be able to find out if there are any compiler errors.
If there are no compile time errors, then we have to follow the logic in the program to find out if there can be any runtime exceptions.
IN your example, as DateFormat class is an abstract class, you cant instantiate it! so it will give compiler error!
I think he meant checked exception here - the exception you must need to catch or "throw" (with throws keyword) to compile your code.
The answer to asked question is, you'll need to "remember" which exception is RunTimeException & which is not.