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

前端 未结 7 1211
既然无缘
既然无缘 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:06

    No, "internal" is not the same as "friend" (at least the C++ 'friend')

    friend specifies that this class is only accessible by ONE, particular class.
    internal specifies that this class is accessible by ANY class in the assembly.

提交回复
热议问题