Which of the following options provides the output of this program, when executed? class Sample4 { public static void main(String []args) { String s1 =" Hello Java"; String s2 = new String("Hello Java"); String s3 =" Hello Java"; if(s1 == s2) { System.out.println("s1 and s2 equal"); } else { System.out.println("s1 and s2 not equal"); } if(s1 == s3) { System.out.println("s1 and s3 equal"); } else { System.out.println("s1 and s3 not equal"); } } }
Reveal answer
Fill a bubble to check yourself