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

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
kapustam
Posts: 2
Joined: Tue Dec 01, 2015 6:22 am
Contact:

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

Post 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"?

admin
Site Admin
Posts: 10386
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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.

kapustam
Posts: 2
Joined: Tue Dec 01, 2015 6:22 am
Contact:

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

Post by kapustam »

Ok, thanks for your answer. I was reading the question 5 times, but not once I understood the question like that.

Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests