Created
March 18, 2015 08:40
-
-
Save VijayKrishna/cf9e2c0b29b72f71bf18 to your computer and use it in GitHub Desktop.
The embarassing existence of unconditional jumps (read goto's) in Java. It (goto) is like a zombie that refuses to just die.
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
public class Goto { | |
public static void main(String[] args) { | |
int count = 0; | |
Goto: | |
for(int i = 0; i < 10; i +=1) { | |
for(int j = 0; j < 10; j += 1) { | |
System.out.println("hello" + count++); | |
break Goto; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment