Author : MD TAREQ HASSAN | Updated : 2021/03/22
What is Access Modifier?
- Access Modifiers are keywords that are used to achieve Abstraction
- In C# (or any other OOP language), there are Access Modifiers keywords
- If no access modifier is used explicitly, dafault access modifier will be used
Access Modifier in CSharp
Declared accessibility | Meaning |
---|---|
public | Access is not restricted |
private | Access is limited to the containing type |
protected | containing class and derived class |
internal | assembly level |
protected internal | derived class and assembly level |
default access modifier (when no access modifier is mentioned) |
fields + structure: private methods + enum : public for class : internal (assembly level) |