Page 1 of 1

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

Posted: Fri Feb 14, 2020 7:13 pm
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:

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

Posted: Fri Feb 14, 2020 11:57 pm
by admin
You are right. This should be fixed.
Added to errata.
thank you for your feedback!