As string is ref type in dotnet, when we update variable x, there should be update in y too ? (as it is referring value of x). sample program given below, how value of y is not changing when x is updated?
public void assignment()
{
string x= "hello";
string y=x; // referencing x as string is ref type in .net
x = x.Replace('h','j');
Console.WriteLine(x); // gives "jello" output
Console.WriteLine(y); // gives "hello" output
}