微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在C#中受保护的访问说明符和受保护的内部有什么区别

访问说明符保护和C#内部受保护有什么区别?

解决方法

内部可以在组件中看到.

受保护的类可以从继承自定义它的类继承.

受保护的内部可以在从定义它的类派生的程序集OR类型中看到(包括来自其他程序集的类型).

见:http://msdn.microsoft.com/en-us/library/ba0a1yw2.aspx

页面复制:

public              Access is not restricted.
protected           Access is limited to the containing class or types derived from the containing class.
internal            Access is limited to the current assembly.
protected internal  Access is limited to the current assembly or types derived from the containing class.
private             Access is limited to the containing type.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐