RuntimeException can be thrown anything because that is an unchecked exception and Unchecked Exceptions need not be declared or caught
the difference between checked and unchecked exceptions:
Checked : Compiler checks whether the exceptions thrown are caught in the program somewhere or not
Unchecked: Compiler does not check the exceptions are caught somewhere or not, means they occur at runtime , like ArrayIndexOutOfBoundsException
SCJP 6 [86%], OCPWCD [84%], OCEJPAD [83%]
If you find any post useful, click the "plus one" sign on the right
Ioan Damian Sirbu
Joined: Dec 22, 2008
Thank you, I suspected it but I was not sure.
So basically, adding an unchecked exception in a method's declaration has absolutely no effect.