Do string-literals have a particular type in C# (like const char* in c++) or does C# just create a new string object for each string-literal that appears in a program ? I am curious to understand what happens behind the scene when the following statement is executed:
string s1 = "OldValue";
does this call a particular method in the string class (a constructor, or an impicit conversion operator, ...) or does C# create a new string object that contains "OldValue" ( then just assign its reference to s1, just like it would for any reference type ) ?
i am trying to understand what it is in the design of the string class that garantees the value of s1 remains "OldValue":
string s2 = s1;
s2 = "NewValue";