Doubt on OCP 1Z0-815 BOOK Deshmukh, Hanumant Page 180
Posted: Fri Feb 14, 2020 7:13 pm
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.
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.
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.

Code: Select all
BAD1:int x=0;/*illegal start of expression*/
BAD2:x++;/*cannot find symbol*/
But if the code is presenting on lines independently this code would work.
Code: Select all
int done=0;
EMPTY_LABEL:++done;
Perhaps the code is present it in a sequence of lines if not is a bug.
