A

Admin • 833.24K Points
Coach

Q. What is the result of:
String s = new String("abc");
String t = "abc";
s == t;

  • (A) true
  • (B) false
  • (C) Compile-time error
  • (D) Runtime error

Explanation by: Admin

s and t are different objects; `==` compares references, not values.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.