Page 1 of 1

About Question enthuware.ocajp.i.v7.2.1326 :

Posted: Thu Aug 23, 2012 7:25 am
by ETS User
Hi Paul,

As per the explanation of the answer:

"Note that the program ends with ExceptionInInitializerError because any exception thrown while constructing an object is wrapped into ExceptionInInitializerError and then that ExceptionInInitializerError is thrown."

Are statements inside constructors and initializing blocks count as statements that construct an object? If so, the explanation might be a little confusing since exceptions thrown in constructors and initializing blocks are not wrapped in ExceptionInInitializerError.

Would it be better to transform it into something like this:

"Note that the program ends with ExceptionInInitializerError because any exception thrown in static blocks is wrapped into ExceptionInInitializerError and then that ExceptionInInitializerError is thrown."

?

Re: About Question enthuware.ocajp.i.v7.2.1326 :

Posted: Thu Aug 23, 2012 7:52 am
by admin
You are right. The explanation is confusing. This has now been updated.

thank you for your feedback!