Multiple choice technology programming languages

package loop; public class TestLoop5 { public static void main(String[] args) { for(;;) { System.out.println("I am in for loop"); } } }

  1. I am in for loop

  2. Infinite Loop

  3. Compiler Error

  4. Exception

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

This code contains an infinite loop because the for loop has no initialization, condition, or increment/decrement parts - it is written as 'for(;;)' which creates an endless loop. The statement 'I am in for loop' will print continuously without termination. Options A, C, and D are incorrect because the code compiles successfully and runs indefinitely.