Exceptions

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
arjun gaur
Posts: 20
Joined: Sun Feb 16, 2014 3:28 am
Contact:

Exceptions

Post by arjun gaur »

q-46 of 91 QID Test 5
Drag and Drop type..
A piece of code is given and we have to tell the type of exception thrown by that code..
check the fourth option ,it's a static block that throws an exception.Why won't it throw an ExceptionInitializerError exception ??it says no exception.although any exception thrown by a static block is wrapped into an ExceptionInitializerError.

admin
Site Admin
Posts: 10398
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: Exceptions

Post by admin »

Please quote qid so that I can look it up. There is a discuss button on the question screen at the bottom that will open the right topic for that question.

BTW, for an exception to be thrown, the code has to compile first.

-Paul.

arjun gaur
Posts: 20
Joined: Sun Feb 16, 2014 3:28 am
Contact:

Re: Exceptions

Post by arjun gaur »

enthuware.ocajp.i.v7.2.1250

admin
Site Admin
Posts: 10398
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: Exceptions

Post by admin »

2.1250 is a different question. It is not a drag and drop. But again, for an exception to be thrown, the code has to compile first. That is why ExceptionInInitializerError is incorrect.

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests