Multiple choice technology programming languages

What is the output for the below code ? public class Test { public static void main(String... args) throws Exception { Integer i = 34; int l = 34; if(i.equals(l)){ System.out.println(true); }else{ System.out.println(false); } } }

  1. true

  2. false

  3. Compile Error

  4. Runtime Exception

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

The code prints true because Integer.equals(Object) performs value comparison after auto-boxing the primitive int 34 to an Integer wrapper, and their primitive integer values are equal.