Why does b.b would not change to "a2" as with f.f?
Thanks.
public class Test
{
public static void Main()
{
Foo f = new Foo
{
f = getStr()
};
Boo b = new Boo
{
b = f.f
};
f.f = "a2";
Console.WriteLine(f.f);
Console.WriteLine(b.b);
}
public static string getStr()
{
string a = "a1";
return a;
}
}
public class Foo
{
public string f { get; set; }
}
public class Boo
{
public string b { get; set; }
}