String a = new String("hi");
String b = new String("hi");
System.out.println(a == b);What is printed?
- Acheck_circle
false
- B
0
- C
true
- D
Error
Explanation
The == operator compares references; new creates two distinct String objects, so a and b refer to different objects.