加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 受保护的内部保护和内部受保护之间有区别吗?

发布时间:2020-12-15 04:34:10 所属栏目:百科 来源:网络整理
导读:public class TestClass{ protected internal int FieldA; internal protected int FieldB; } 受保护的内部成员和内部成员之间是否存在差异? 解决方法 Is there a difference between protected internal and internal protected members? 它们之间没有区别
public class TestClass
{
    protected internal int FieldA;
    internal protected int FieldB;    
}

受保护的内部成员和内部成员之间是否存在差异?

解决方法

Is there a difference between protected internal and internal protected
members?

它们之间没有区别.

受保护的内部意味着保护或内部

内部保护意味着内部或受保护.

The type or member can be accessed by any code in the assembly in
which it is declared,or from within a derived class in another
assembly. Access from another assembly must take place within a class
declaration that derives from the class in which the protected
internal element is declared,and it must take place through an
instance of the derived class type.

在这两者中,通常使用受保护的内部. MSDN page about Access Modifiers上没有对内部保护的引用.

另请参阅Phil Haack的博客文章What Does Protected Internal Mean?

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读