Sail E0 Webinar
Question


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));
}
}
Options:
A .  true true
B .  false false
C .  true false
D .  false true
Answer: Option C

None.
Output:
$ javac output.java
$ java output
true false



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers