About Question enthuware.ocajp.i.v7.2.963 :

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

Moderator: admin

Post Reply
dmcinnis1
Posts: 16
Joined: Wed Feb 25, 2015 8:52 pm
Contact:

About Question enthuware.ocajp.i.v7.2.963 :

Post by dmcinnis1 »

hi,

I tried INT1 = 100 and INT2 = 0. The condition clause fails I assumed the println statement would not be executed. INT1 and INT2 could be any integer values. What am I missing?

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

Re: About Question enthuware.ocajp.i.v7.2.963 :

Post by admin »

Since INT1 and INT2 can be any two integers, the code should produce the same output for any values. Not just INT1=100 and INT2 = 0.

dmcinnis1
Posts: 16
Joined: Wed Feb 25, 2015 8:52 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.963 :

Post by dmcinnis1 »

I bobbled it! thanks for your patience.

Mushfiq Mammadov
Posts: 32
Joined: Fri Oct 16, 2015 4:33 am
Contact:

Re: About Question enthuware.ocajp.i.v7.2.963 :

Post by Mushfiq Mammadov »

The question is clear, but it would be good to add "(INT1 < INT2)" after "INT1 and INT2 can be any two integers" for more clarity. Because if we use vice-versa (INT1 = 3 and INT2 = 1) the result of option 1, option 2, option 3 and the orginal code are same: no output

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

Re: About Question enthuware.ocajp.i.v7.2.963 :

Post by admin »

INT1 and INT2 can be any numbers. Not just INT1<INT2. So even if some code snippets produce the same output for INT1>INT2, you need to check whether they do so for INT1<INT2 as well before selecting them as correct options.

Mushfiq Mammadov
Posts: 32
Joined: Fri Oct 16, 2015 4:33 am
Contact:

Re: About Question enthuware.ocajp.i.v7.2.963 :

Post by Mushfiq Mammadov »

Oh, you are right, it have to be consistent for both case

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests