Skip to content

Commit 7bba73c

Browse files
authored
Merge pull request eugenp#4279 from psysane/master
[BAEL-1796] Infinite loop using Java
2 parents fb04fc4 + cd84ca0 commit 7bba73c

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.baeldung.loops;
2+
3+
public class InfiniteLoops {
4+
5+
public void infiniteLoopUsingWhile() {
6+
while (true) {
7+
System.out.println("Infinite loop using while");
8+
}
9+
}
10+
11+
public void infiniteLoopUsingFor() {
12+
for (;;) {
13+
System.out.println("Infinite loop using for");
14+
}
15+
}
16+
17+
public void infiniteLoopUsingDoWhile() {
18+
do {
19+
System.out.println("Infinite loop using do-while");
20+
} while (true);
21+
}
22+
23+
}

0 commit comments

Comments
 (0)