Default Class Accessibility in C#
There are two rules for Default Class Accessibility in C# as in the following:
1. Top-level classes, which are not nested in other classes, can only have internal or public accessibility. The default accessibility for these classes is internal.
2. Nested classes, which are members of other classes, can have declared accessibility as indicated in the following table.
Ref: Accessibility Levels (C# Reference), msdn.microsoft.com, Nov. 06, 2016.
There are two rules for Default Class Accessibility in C# as in the following:
1. Top-level classes, which are not nested in other classes, can only have internal or public accessibility. The default accessibility for these classes is internal.
2. Nested classes, which are members of other classes, can have declared accessibility as indicated in the following table.
Members of | Default member accessibility | Allowed declared accessibility of the member |
---|---|---|
enum | public | None |
class | private | public protected internal private protected internal |
interface | public | None |
struct | private | public internal private |
Ref: Accessibility Levels (C# Reference), msdn.microsoft.com, Nov. 06, 2016.
No comments:
Post a Comment