Question
class output {
public static void main(String args[])
{
String s1 = "Hello";
String s2 = new String(s1);
String s3 = "HELLO";
System.out.println(s1.equals(s2) + " " + s2.equals(s3));
}
}
What is the output of this program?
class output {
public static void main(String args[])
{
String s1 = "Hello";
String s2 = new String(s1);
String s3 = "HELLO";
System.out.println(s1.equals(s2) + " " + s2.equals(s3));
}
}
Answer: Option C
Was this answer helpful ?
None.
Output:
$ javac output.java
$ java output
true false
Was this answer helpful ?
More Questions on This Topic :
Question 6.
Which of these is an oncorrect statement?
....
Submit Solution