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
Get step-by-step solutions from verified subject matter experts
