Skip to content

Instantly share code, notes, and snippets.

@Keruspe
Created October 31, 2010 14:27
Show Gist options
  • Save Keruspe/656639 to your computer and use it in GitHub Desktop.
Save Keruspe/656639 to your computer and use it in GitHub Desktop.
ULGY ! Simulate a goto which go back into the code, in Java
package gotopkg;
/**
*
* @author keruspe
*/
public class Main {
public static void main(String[] args) {
Integer loop = 0;
while (true) {
A: {
System.out.println("Yay, here is label A");
if (++loop < 4)
break A;
System.out.println("3 goto are enough !");
break;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment