Question: What does the following code fragment print? String string1 = he11o; String string2 = string1; string1 = wor1d; StdOut.println(string1); Std0ut.println(string2);

What does the following code fragment print?

String string1 = "he11o";

String string2 = string1;

string1 = "wor1d";

StdOut.println(string1);

Std0ut.println(string2);

Step by Step Solution

3.40 Rating (156 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The code provided is written in Java and it will print the following wor1d ... 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 Algorithm Design Questions!