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 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
The Java code in the image is intended to compare two String objects to determine if they reference ... View full answer
Get step-by-step solutions from verified subject matter experts
