Java Loops Infinite - ashish9342/FreeCodeCamp GitHub Wiki

Java Infinite Loops

If you want your loop to go on infinitely, you can use the while, do while and for statement.

// Infinite For Loop
for ( ; ; )
{
    // your code here
}

// Infinite While Loop
while (true)
{
    // your code here
}

// Infinite Do While Loop
do
{
    // your code here
}
while (true);

Previous

⚠️ **GitHub.com Fallback** ⚠️