Page 1 of 1
Regarding Question : com.enthuware.ets.scjp.v6.2.35
Posted: Thu Nov 01, 2012 8:31 pm
by ETS User
I believe that for the option 3 the correct answer should be : "Will not compile" as there is no indication that a ClassNotFoundException is thrown anywhere, either at the method level or in try/catch block. Assuming this is done, the provided answer is correct.
Re: Regarding Question : com.enthuware.ets.scjp.v6.2.35
Posted: Fri Nov 02, 2012 3:48 pm
by ETS User
Why nobody answers my question?? Because answer is obviously wrong???
Re: Regarding Question : com.enthuware.ets.scjp.v6.2.35
Posted: Fri Nov 02, 2012 5:05 pm
by admin
Hello,
I see that Option 3 is set to "No exception will be thrown", which is correct.
Regarding the time it took for responding, different question banks are supported by different people so it is possible that one question may be answered before another. We try to answer as soon as possible but it is not always possible to respond immediately. Rest assured that each question will be answered.
HTH,
Paul.
Re: Regarding Question : com.enthuware.ets.scjp.v6.2.35
Posted: Fri Nov 02, 2012 7:48 pm
by ETS User
That's simply not correct. I explained why.
Re: Regarding Question : com.enthuware.ets.scjp.v6.2.35
Posted: Fri Nov 02, 2012 8:05 pm
by admin
The question asks you to identify the exception that will be thrown by the given line of code:
Code: Select all
Class.forName("java.lang.String");
This line of code has no compilation issue as such and it will not throw any exception either.
It is correct that try/catch or throws clause is not shown. But the question is only asking about the given line and not the whole code. If you think that way, then none of the given options will compile because there is no class statement, no method, or no body for any of the code fragments. One may also think that the code may be in a file with an inappropriate name. There can be several things, which are not specified in the question, that can go wrong. But you don't have to consider that. You just need to consider the code fragment that is given and assume that everything else is valid.
The questions in the exam expect you to assume the same thing. i.e. things that are not specified are valid.
HTH,
Paul.