Question: What is the output of the following program? String s1 = Welcome to Java; String s2 = new String(Welcome to Java); String s3 =
What is the output of the following program? String s1 = "Welcome to Java"; String s2 = new String("Welcome to Java"); String s3 = "Welcome to Java"; System.out.println("s1==s2 System.out.println("s1==s3 is " + (s1==s2)); is " + (s1==s3));
Step by Step Solution
3.47 Rating (154 Votes )
There are 3 Steps involved in it
output s1s2 is false s1s3 is true Explanation In Java there are two types of string objects string l... View full answer
Get step-by-step solutions from verified subject matter experts
