Question: Consider the following code segment. String stringl = Hello; String string2 = World; string2 = string1; string1 += There!; After the code is executed, what

Consider the following code segment. String stringl = "Hello";

String string2 = "World";

string2 = string1;

string1 += "There!";

After the code is executed, what are the values of s tring1 and string2?

a. string1 "Hello", string2 = "World"

b. string1 "HelloWorld", string2 = "World"

c. string1 "HelloThere!", string2 "HelloThere!"

d. string1 "HelloThere!", string2 = "World"

e. string1 "HelloThere!", string2 = "Hello"

Step by Step Solution

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 Databases Questions!