Re: About Question enthuware.ocajp.i.v7.2. 1090 :

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

Moderator: admin

Post Reply
Nisim123
Posts: 42
Joined: Mon Jan 20, 2014 2:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2. 1090 :

Post by Nisim123 »

It will be easier to say that it will not compile since j is not initialized :

Code: Select all

int sum = 0;
      for (int i = 0, j = 10; sum > 20; ++i, --j)      // 1
      {.........
I cannot say what prevents you from marking this option as a correct answer,
this compile time error comes before the boolean condition of the for statement.... :|
Last edited by admin on Fri Jul 04, 2014 7:15 am, edited 1 time in total.
Reason: Updated subject to scramble qid

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

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

Post by admin »

Not sure what you mean. It compiles and runs fine.

Nisim123
Posts: 42
Joined: Mon Jan 20, 2014 2:26 pm
Contact:

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

Post by Nisim123 »

Yes, well you are probably right. I was probably confused with the way int j is initialized inside the for loop's declaration...

:geek:

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests