[Mono-dev] private members

Mark Probst mark.probst at gmail.com
Mon Dec 10 09:23:48 EST 2007

> Given the following program, I have a question about Mono and .Net.  This is
> not a bug in Mono because I think the same thing happens on Windows, but I
> was hoping someone could explain it to me.  The line below with the comment
> is surprising because it is accessing a private variable of another
> instance.  Why does it compile?  Shouldn't it say that member bar is not
> visible?

The scope of access protection is the class, not the instance.


More information about the Mono-devel-list mailing list