Home » JAVA Programming » Strings » Question
  1. What is the output of this program?

    public class Result
    {
    public static void main(String args[])
    {
    String str1 = "Hello";
    String str2 = new String(str1);
    String str3 = "HELLO";
    System.out.println(str1.equals(str2) + " " + str2.equals(str3));
    }
    }
    1. false
    2. true
    3. true false
    4. false true
    5. None of these
Correct Option: C

true false



Your comments will be displayed only after manual approval.