Multiple choice technology programming languages

What is the result os this String s1="hi"; String s2="hi"; (s1==s2)-->returns

  1. true

  2. false

  3. compilation error

  4. exception thrown at runtime

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

String literals in Java are stored in the string pool and reused. Both s1 and s2 reference the same 'hi' literal from the pool. The '==' operator compares references, and since both point to the same object, s1 == s2 returns true.