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"?
About Question com.enthuware.ets.scjp.v6.2.692 :
Moderator: admin
-
- Posts: 2
- Joined: Tue Dec 01, 2015 6:22 am
- Contact:
-
- Site Admin
- Posts: 10386
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.692 :
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.
HTH,
Paul.
-
- Posts: 2
- Joined: Tue Dec 01, 2015 6:22 am
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.692 :
Ok, thanks for your answer. I was reading the question 5 times, but not once I understood the question like that.
Who is online
Users browsing this forum: No registered users and 13 guests