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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -