Multiple choice technology programming languages

consider the following scenarioint i = 0;if ( i ) {System.out.println("This won't print");}else{System.out.println("This prints");}

  1. This won't print

  2. This prints

  3. There's a runtime exception

  4. scenario is not legal

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

In Java, an if statement condition must evaluate to a boolean value. Passing an integer variable i directly into the condition is illegal and causes a compilation error.