Re: Encapsulation



On May 24, 12:07 am, Jon Harrop <j...@xxxxxxxxxxxxxxxxx> wrote:
I have two separate classes and would like the members of one class to have
access to the private members of another class. What is the idiomatic C#
solution to this?

I believe C++ would use "friends".

--
Dr Jon D Harrop, Flying Frog Consultancyhttp://www.ffconsultancy.com/products/?u

If you let both classes inherit from a third superclass, you can use
"protected" to let them see each other's data (I think). I would not
do that, however, without documenting it prominently.
.



Relevant Pages


Loading