Default Access modifiers in C#?
An enum has default modifier as public
A class has default modifiers as Internal . It can declare members (methods etc) with following access modifiers:
public
internal
private
protected internal
An interface has default modifier as public
A struct has default modifier as Internal and it can declare its members (methods etc) with following access modifiers:
public
internal
private
A methods, fields, and properties has default access modifier as "Private" if no modifier is specified.
A class has default modifiers as Internal . It can declare members (methods etc) with following access modifiers:
public
internal
private
protected internal
An interface has default modifier as public
A struct has default modifier as Internal and it can declare its members (methods etc) with following access modifiers:
public
internal
private
A methods, fields, and properties has default access modifier as "Private" if no modifier is specified.
The internal keyword is an access modifier for types and type members ie. we can declare a class as internal or its member as internal. Internal members are accessible only within files in the same assembly (.dll). In other words, access is limited exclusively to classes defined within the current project assembly.
No comments:
Post a Comment