What will the following code print?
void m (){ int c = 0; Label1 : while (c < 8){ Label2: System.out.println (c); if (c > 3) break Label2; else c++; } }
Select 1 option
Correct Option is : A
Because break Label2; would be valid only when it is within the block of code under the scope of the label Label2.
In this case, the scope of Label2 extends only up till System.out.println (c); and break Label2; is out of the scope of the label.