Why there are no friend classes in C#? [duplicate]
Possible Duplicate:
Why does C# not provide the C++ style ‘friend’ keyword?
A typical example where it might be needed
I have a class with private Init()
function and class factory
which I would like to grant access to Init()
;
There are no friends in C#, it's true, but you can put these classes into same file, so they both will be able to access each other's functions. Or use "partial" classes, putting only init() function of each class into the same file where your factory resides
精彩评论