A default access level is used if no access modifier is specified in a member declaration. The following list defines the default access modifier for certain C# types:
enum: The default and only access modifier supported is public.
class: The default access for a class is private. It may be explicitly defined using any of the access modifiers.
interface: The default and only access modifier supported is public.
struct: The default access is private with public and internal supported as well.
The default access may suffice for a given situation, but you should specify the access modifier you want to use to ensure proper application behavior.
Note: Interface and enumeration members are always public and no access modifiers are allowed.
No comments:
Post a Comment