Last active
April 10, 2017 00:18
-
-
Save ntcho/55be67e1e2a97ae1b2fced2e1d389536 to your computer and use it in GitHub Desktop.
Java loops
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 static void main(String args[]) { | |
int i = 0, j = 0, k = 0; | |
// for statement | |
for (i = 0; i < 5; i++) { | |
print(i); | |
} | |
// while statement | |
while (j < 5) { | |
print(j++); | |
} | |
// do while statement | |
do { | |
print(k++); | |
} while (k < 5); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment