java - SCJP with label -


below compilation fail due "label z missing" if move z: 1 step below after o = o + 2 work? logic behind this?

public class breaker { static string o = "";  public static void main(string[] args) { z:  o = o + 2; (int x = 3; x < 8; x++) {     if (x == 4)     break;     if (x == 6)     break z;     o = o + x; } system.out.println(o); } } 

you cannot put labels anywhere in code. should before statements. in case labelname: for(;;){} here's documentation


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

java - Using an Integer ArrayList in Android -