while(true) loop in java code example
Example 1: while loop in java
// Java infinite while loop
import java.util.*;
public class WhileLoopExample
{
public static void main(String[] args)
{
boolean value = true;
while(value)
{
System.out.println("Infinite loop");
}
}
}
Example 2: what is a do while loop in java
do {
//something you want to execute at least once
} while (someBooleanCondition);