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

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

Moderator: admin

Post Reply
ETS User

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

Post by ETS User »

I'm not sure about the correct answer to this question. I think that the right answer should be the fourth, not the third. When class B is run it calls the overriden method getItDone(int countert), passing a -4 value. This method asserts if counter is less than 100. If the assertion is true (I think that -4 is less than 100 8-) ) the program enters an endless loop. But, the explanation to this question says that the loop is never entered, and the correct answer is the third.

Why?

Please, forgive my english, I'm not native.

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

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

Post by admin »

That is because i is -4 and the loop condition is i>0.

HTH,
Paul.

Guest

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

Post by Guest »

Oh sorry I missed the easiest part :oops:

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 19 guests