C# Access Modifiers
Declared Accessibility | Description |
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. |
Declared Accessibility Rules
Parent | Parent Default Accessibility | Allowed Declared Accessibility of the Parent | Member Default Accessibility | Allowed Declared Accessibility of the Member |
namespace | public | None | internal | internal public |
enum | public | None | public | None |
class | internal | All | private | All |
interface | internal | internal public | public | None |
struct | internal | internal public | private | internal public private |
constructor | protected | All | ||
field | private | All | ||
delegate | internal | internal public |
No comments:
Post a Comment