Regarding Question : com.enthuware.ets.scjp.v6.2.35
Moderator: admin
Regarding Question : com.enthuware.ets.scjp.v6.2.35
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
Why nobody answers my question?? Because answer is obviously wrong???
-
- Site Admin
- Posts: 10398
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: Regarding Question : com.enthuware.ets.scjp.v6.2.35
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.
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
That's simply not correct. I explained why.
-
- Site Admin
- Posts: 10398
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: Regarding Question : com.enthuware.ets.scjp.v6.2.35
The question asks you to identify the exception that will be thrown by the given line of code:
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.
Code: Select all
Class.forName("java.lang.String");
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.
Who is online
Users browsing this forum: No registered users and 8 guests