Created
October 31, 2010 14:27
-
-
Save Keruspe/656639 to your computer and use it in GitHub Desktop.
ULGY ! Simulate a goto which go back into the code, in Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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