Question: public class TestString1 { public static void main(String [] args) { String st1= Hello; String st2 = new String(st1); System.out.println(st1==st2); } } What is

public class TestString1 { public static void main(String [] args) { String 

public class TestString1 { public static void main(String [] args) { String st1= "Hello"; String st2 = new String(st1); System.out.println(st1==st2); } } What is the output of the above program?

Step by Step Solution

3.43 Rating (150 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The Java code in the image is intended to compare two String objects to determine if they reference ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!