44.2k views
2 votes
What would be assigned to 'name' after the following code?

String name = "Kyle"'
Sting lastName = "Schwarber"'
name = (lastName);
A) KyleSchwarber
B) Kyle Schwarber
C) Schwarber, Kyle
D) Schwarber Kyle
E) SchwarberKyle

User Slicekick
by
8.4k points

1 Answer

2 votes

Final answer:

The value assigned to 'name' after the code would be 'KyleSchwarber.'

Step-by-step explanation:

The correct answer is A) KyleSchwarber. After the code name = (lastName); the value of name will be set to the value of lastName, which is Schwarber. Therefore, the value of name will be KyleSchwarber.

User Thesquaregroot
by
8.2k points