Multiple choice technology programming languages

Integer i1=10; Integer i2=10; (i1.equals(i2++))-->result is

  1. true

  2. false

  3. compilation error

  4. exception thrown at runtime

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

The equals method compares the value of the Integer object i1, which is 10, with the value of the argument. The expression i2++ uses the post-increment operator, so it evaluates to 10 for the comparison and then increments i2 to 11. Since 10 equals 10, the equals method returns true.