Question: What is the output of the following code? class Main { public static void main(String args[]) String abc = Welcome to Chegg; String xyz

What is the output of the following code? class Main { public

What is the output of the following code? class Main { public static void main(String args[]) String abc = "Welcome to Chegg"; String xyz = new String(abc); if (abc == xyz) System.out.println((abc == xyz) + " " + abc.equals (xyz)); %3D else + abc.equals (xyz)); System.out.println((abc == xyz) + } } . 1 0 b. 0 true c. false true d. true true

Step by Step Solution

3.41 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!