What is the equivalent of a 'friend' keyword in C Sharp?

前端 未结 7 1190
既然无缘
既然无缘 2021-02-18 15:52

What is the equivalent of a \'friend\' keyword in C Sharp?

How do I use the \'internal\' keyword?

I have read that \'internal\' keyword is a replacement for \'fr

7条回答
  •  星月不相逢
    2021-02-18 16:16

    Internal is the equivalent of friend. A protected method is only available within the same class or from an inheritor. If you're trying to expose protected methods from an inheritor, you can wrap them in public methods.

提交回复
热议问题