Examveda
Examveda

What will be the output of the following Java code?
class output 
{
    public static void main(String args[])
    { 
       String s1 = "Hello i love java";
       String s2 = new String(s1);
       System.out.println((s1 == s2) + " " + s1.equals(s2));
    }
}

A. true true

B. false false

C. true false

D. false true

Answer: Option D


This Question Belongs to Java Program >> Strings

Join The Discussion

Related Questions on Strings