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.
Exceptions
Moderator: admin
-
- Site Admin
- Posts: 10398
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: Exceptions
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.
BTW, for an exception to be thrown, the code has to compile first.
-Paul.
-
- Posts: 20
- Joined: Sun Feb 16, 2014 3:28 am
- Contact:
Re: Exceptions
enthuware.ocajp.i.v7.2.1250
-
- Site Admin
- Posts: 10398
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: Exceptions
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.
Who is online
Users browsing this forum: No registered users and 11 guests