Question PRG-JAVA-0042
MediumWhat is the output of this program?
public class Main {
public static void main(String[] args) {
String a = "hello";
String b = "hello";
String c = new String("hello");
System.out.println((a == b) + " " + (a == c) + " " + a.equals(c));
}
}
- A.
false false true
- B.
true false true
- C.
Sign up free to see the answer and a step-by-step explanation.