Page 1 of 1

About Question com.enthuware.ets.scjp.v6.2.741 :

Posted: Wed Nov 30, 2011 10:12 pm
by ETS User
Return type for val() method is "int" but it doesn't have a return statement. How can this compile?

static int val() throws Exception {
throw new Exception("unimplemented");
}

Re: About Question com.enthuware.ets.scjp.v6.2.741 :

Posted: Thu Dec 01, 2011 9:10 pm
by admin
return is not the only way a method can end. In case of an exception, the method is not required to return any value. The compiler notices that this method always ends up with an exception and so does not complain for a return value.

HTH,
Paul

Re: About Question com.enthuware.ets.scjp.v6.2.741 :

Posted: Mon Jan 17, 2022 10:37 am
by sijucm
Great question, but are we sure Oracle people ask these kind of questions? Is these kind of code real life? Isn't that why we have computers? Do I have to remember? Of course I can remember this but then not with the breadth. If they want me to remember what Path.relativize() will do if one of the path is absolute.
These kind of things make this certification a coin toss. I'm pretty sure I can ask many questions back to the question makers that they do not know. What are we trying to prove with a certification that the person is an Artificial Intelligence, computer with no real-life skills? Sorry about this rant, but the amount of information I have to remember just so that I can forget it immediately is high.

Re: About Question com.enthuware.ets.scjp.v6.2.741 :

Posted: Mon Jan 17, 2022 10:20 pm
by admin
Unfortunately, yes. Every aspect that we have touched upon in our questions is within the scope of the exam. You do need to learn this stuff for the exam.