Access Modifiers (Access Specifiers) describes as the scope of accessibility of an Object and its members. We can control the scope of the member object of a class using access specifiers. The following five accessibility levels can be specified using the access modifiers:
public, private , protected , internal and protected internal
public: Access level is not restricted.
protected: Access level is limited to the containing class or types derived from the containing class.
Internal: Access level is limited to the current assembly.
protected internal: Access level is limited to the current assembly or types derived from the containing class.
private: Access level is limited to the containing type.
If no modifier is specified, the method is given private access.You can see here more details about... Access Specifiers
- What is object-oriented programming?
- What is a Class?
- What is an Object?
- Constructors and Destructors
- What Is Inheritance ?
- What are the different types of inheritance ?
- Why Classes cannot be declared as Protected?
- Can we declare private class in namespace
- Difference between Classes and Structures
- Can we use pointers in C# ?
- Why abstract class can't create instance
- Can you prevent your class from being inherited
- Difference between method Overloading and Overriding
- Difference between Early Binding and Late binding
- What is nested class
- What is partial class ?
- What is Virtual Method
- Difference between class and object
- What is Data Encapsulation?
- Object Based Language and OOPs
- SOLID Principles in Object-Oriented Programming
- Solid Principles | Advantages and Disadvantages