Analyze the following code: boolean even = false; if (even = true) { System.out.println("It is even!"); }

  1. The program has a syntax error.

  2. The program has a runtime error.

  3. The program runs fine, but displays nothing.

  4. The program runs fine and displays It is even!.


Correct Option: D

Find more quizzes: