If strings in .NET are reference types, in the below code, why doesn't string2 change to "hi" after string1 is changed?
static void IsStringReallyAReference()
{
string string1 = "hello";
string string2 = string1;
Console.WriteLine("-- Strings --");
Console.WriteLine(string1);
Console.WriteLine(string2);
string1 = "hi";
Console.WriteLine(string1);
Console.WriteLine(string2);
Console.Read();
}
/*Output:
hello
hello
hi
hello*/
