Page 1 of 1

About Question com.enthuware.ets.scjp.v6.1.820 :

Posted: Thu Apr 12, 2012 3:03 pm
by Pierluigi
I think that the explanation given in the answer contains an invalid statement:
"All exceptions given in the options other than Exception, are RuntimeExceptions".
There is also "ClassNotFoundException" among the given exceptions, which is not a RuntimeException. It directly inherits from Exception, thus it's a checked exception, that IS thrown by the API (example: method readObject() and writeObject()).

Re: About Question com.enthuware.ets.scjp.v6.1.820 :

Posted: Thu Apr 12, 2012 9:01 pm
by admin
You are right. It has been changed to NoClassDefFoundError and the explanation has been updated to that it is thrown by the JVM when it attempts to load a class and is unable to find the class file. It extends ///java.lang.Error/// and Errors are always thrown by the JVM. A programmer should never throw an Error explicitly.

thank you for your feedback!