Question:Consider the following code:
string s1 = "Old Value";
string s2 = s1;
s1 = "New Value";
Console.WriteLine(s2);
What will be the output printed, and why? 

A "New Value", because string is a reference type. 

B "Old Value", because string is a value type. 

C "New Value", because string is a value type. 

D "Old Value", because string is a reference type 

E "Old Value", because string is a reference type which is treated as a special case by the assignment operator. 

+ Answer
+ Report
Total Preview: 1685

Copyright © 2024. Powered by Intellect Software Ltd