Multiple choice technology programming languages

package loop; public class TestLoop4 { public static void main(String[] args) { for(int i=1,j=1; i<2,j<2;i++,j++) { System.out.println("i= "+i+" j = "+j); } } }

  1. Compiler Error

  2. i= 1 j = 1

  3. i= 1 j = 0

  4. Exception

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

In Java, the condition expression of a for loop must evaluate to a single boolean value. Using a comma operator like i&lt;2,j&lt;2 is invalid syntax in Java and causes a compiler error. Java does not support the comma operator in the condition section of loops.