For <code>String a = new String("hi"); String b = new String("hi");</code> — what is <code>a == b</code> and <code>a.equals(b)</code>?
- A
== true; equals false
- B
Both false
- C
Both true
- Dcheck_circle
== false; equals true
Explanation
<code>==</code> compares references (different objects → false); <code>.equals</code> compares content (same content → true).