Access Modifiers

Write short notes on access modifiers ?

Access modifiers provide the accessibility control for the members of classes to outside the class. They also provide the concept of data hiding. There are five member access modifiers provided by the C# Language.

By default all members of class have private accessibility. If we want a member to have any other accessibility, then we must specify a suitable access modifier to it individually.

For Example:

class Demo

{

public int a;

interna1 int x;

protected double d;

float m; // private by default

}

Leave Comment

Important Topics

Title
Object Oriented Programming (OOP)
OOP vs POP
Class with Example
Objects
Access Modifiers
Encapsulation with example
C# Properties (GET, SET)
Method and Function
Abstraction
Polymorphism
Operator Overloading
Inheritance
Constructor and its Types
Exception Handling
Throwing an Exception