Merge pull request #4279 from psysane/master
[BAEL-1796] Infinite loop using Java
This commit is contained in:
commit
7bba73c6eb
|
@ -0,0 +1,23 @@
|
|||
package com.baeldung.loops;
|
||||
|
||||
public class InfiniteLoops {
|
||||
|
||||
public void infiniteLoopUsingWhile() {
|
||||
while (true) {
|
||||
System.out.println("Infinite loop using while");
|
||||
}
|
||||
}
|
||||
|
||||
public void infiniteLoopUsingFor() {
|
||||
for (;;) {
|
||||
System.out.println("Infinite loop using for");
|
||||
}
|
||||
}
|
||||
|
||||
public void infiniteLoopUsingDoWhile() {
|
||||
do {
|
||||
System.out.println("Infinite loop using do-while");
|
||||
} while (true);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue