Page 1 of 1

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

Posted: Tue Dec 01, 2015 6:39 am
by kapustam
It's not really clear to my why option 4 is not correct. The question stands that if no arguments are given (so assuming args.length = 0), the code should exit without output or exception.
But for that condition is the int = -1 and it will never pass to SYSO, because this -1 > 0 is false.
Why is there answer: "if there is only one argument i will be 1-1 = 0" when the question stands for "no arguments are given"?

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

Posted: Tue Dec 01, 2015 7:09 am
by admin
Question doesn't just say that no arguments are given. Question says that the code needs to print the last argument and if no arguments are given then it should exit without any output or exception.
HTH,
Paul.

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

Posted: Tue Dec 01, 2015 7:18 am
by kapustam
Ok, thanks for your answer. I was reading the question 5 times, but not once I understood the question like that.