H
Hyun-jik Bae
Is there any way to prohibit writing values to an object A retrieved from
another object B if B gives A for read only purpose?
For example,
public class B
{
public int xx;
}
public class A
{
public B aa=new B();
public B a
{
get
{
return aa;
}
}
}
class Program
{
static void Main(string[] args)
{
A q = new A();
int w=q.a.xx;
q.a.xx = 3; // STATEMENT X
}
}
where I want STATEMENT X be prohibited.
Please reply. Thanks in advance.
Hyun-jik Bae
another object B if B gives A for read only purpose?
For example,
public class B
{
public int xx;
}
public class A
{
public B aa=new B();
public B a
{
get
{
return aa;
}
}
}
class Program
{
static void Main(string[] args)
{
A q = new A();
int w=q.a.xx;
q.a.xx = 3; // STATEMENT X
}
}
where I want STATEMENT X be prohibited.
Please reply. Thanks in advance.
Hyun-jik Bae