RAM*_*RAM 6 .net c# protected access-modifiers internal
public class TestClass
{
protected internal int FieldA;
internal protected int FieldB;
}
Run Code Online (Sandbox Code Playgroud)
受保护的内部成员和内部成员之间是否存在差异?
protected internal和internal protected成员之间有区别吗?
它们之间没有区别.
protected internal是指protectedOR internal.
internal protected是指internalOR protected.
类型或构件可以通过在声明它,该组件的任何代码被访问或从另一个组件中的导出类中.来自另一个程序集的访问必须在一个类声明中进行,该类声明派生自声明受保护的内部元素的类,并且它必须通过派生类类型的实例进行.
其中,protected internal常用.MSDN页面internal protected上没有关于访问修饰符的引用.
另请查看Phil Haack的博客文章 What Does Protected Internal Mean?
| 归档时间: |
|
| 查看次数: |
3427 次 |
| 最近记录: |