Question PRG-JAVA-0061
HardWhat is the output of this program?
public class Main {
public static void main(String[] args) {
String s1 = "Java";
String s2 = "Ja" + "va";
String s3 = new String("Java").intern();
String part = "Ja";
String s4 = part + "va";
System.out.println((s1 == s2) + " " + (s1 == s3) + " " + (s1 == s4));
}
}
- A.
true true false
- B.
true true true
- C.
Sign up free to see the answer and a step-by-step explanation.