Q: Which of the following loops runs without any condition and runs infinitely?
-
A
do while, for loop
-
B
while loop
-
C
finite loop
-
D
infinite loop
D
Answer:
D
Explanation:
The correct option is:
infinite loop
An infinite loop runs continuously without any condition to terminate. Examples of such loops in Java include while(true) or for(;;). The other loops, like do while, for, and while, typically have conditions that can terminate them.
Related Topic:
Share Above MCQ