About Question enthuware.ocajp.i.v7.2.1326 :
Posted: Thu Aug 23, 2012 7:25 am
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."
?
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."
?