Doubt on OCP 1Z0-815 BOOK Deshmukh, Hanumant Page 180

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

Moderator: admin

Post Reply
javiut
Posts: 37
Joined: Fri Oct 19, 2012 10:48 am
Contact:

Doubt on OCP 1Z0-815 BOOK Deshmukh, Hanumant Page 180

Post by javiut »

On this page i have a doubt perhaps this code is a sequence of lines right i mean this in fact this is not compiling.

Code: Select all

        BAD1:int x=0;/*illegal start of expression*/
        BAD2:x++;/*cannot find symbol*/
The 1 line is wrong because you cant declare a variable on a label and the second is not compiling neither because is calling a variable not defined.

But if the code is presenting on lines independently this code would work.

Code: Select all

 int done=0;
  EMPTY_LABEL:++done;
I mean is possible to update a variable on a label.

Perhaps the code is present it in a sequence of lines if not is a bug.

:thumbup:

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

Re: Doubt on OCP 1Z0-815 BOOK Deshmukh, Hanumant Page 180

Post by admin »

You are right. This should be fixed.
Added to errata.
thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: clement_r, Google [Bot] and 9 guests