I'm confused by the following. If string is a reference type in C# and gets passed as a reference type, why doesn't changing the parameter value inside the method lead to change of value in the original argument?
Surely, value at which the reference 'z' points to has been changed to "Mike" in the method?
public static void ChangeStudentName(string param)
{
param = "Mike";
}
string z = "Bill";
ChangeStudentName(z);
Console.WriteLine(z);
Output - Bill