Multiple Choices
}
}
(Choose 1 answer)
What is the output when the program below is run?
public class Test{
public static void main(String[] args){
String s1 = "xyz";
String s2 = new String(s1);
if (s1 == s2)
System.out.println("Line 4");
if (s1.equals(s2))System.out.println("Line 6");
What is the output?
A. Line 4
B. Line 6
C. Line 4 Line 6
D. No output, compile error
E. No output