P
puzzlecracker
When I create a reference type as readonly, can I modify its internals
but not resassing?
class A
{
private int _x;
public int X
{
get; set;
}
}
public static void Main(string [] args){
readonly A a=new A();;
A b=new A();
a.X=5; //is this allowed?
a=b; // is this allowed?
}
but not resassing?
class A
{
private int _x;
public int X
{
get; set;
}
}
public static void Main(string [] args){
readonly A a=new A();;
A b=new A();
a.X=5; //is this allowed?
a=b; // is this allowed?
}