Jul 27 in JAVA
Q: How is an infinite loop declared in Java?

1 Answer

0 votes
Jul 27

Infinite loops are those loops that run infinitely without any breaking conditions. Some examples of consciously declaring infinite loop is:

Using For Loop:

for (;;)

{

   // Business logic

   // Any break logic

}

Using while loop:

while(true){

   // Business logic

   // Any break logic

}

Using do-while loop:

do{

   // Business logic

   // Any break logic

}while(true);

Related questions

0 votes
Mar 11 in PL/SQL
0 votes
Jan 24, 2020 in JAVA
...