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");
}
About Question com.enthuware.ets.scjp.v6.2.741 :
Moderator: admin
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.741 :
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
HTH,
Paul
If you like our products and services, please help us by posting your review here.
-
- Posts: 8
- Joined: Tue Jan 11, 2022 4:41 am
Re: About Question com.enthuware.ets.scjp.v6.2.741 :
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.
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.
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.741 :
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.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: marpiva and 30 guests