Acsess modifiers

Types:

1.public

2.private

3.protected

4.internal

5.protected internal

6.private protected


1.public:

it can be accessed from anywhere


2.private:

 it can only be accessed within the same class or struct.


3.protected:

it can only be accessed from the same class and its derived classes. 


4.internal:

 it can be accessed only within the same assembly.


5.protected internal:

it can be accessed from the same assembly and the derived class of the containing class from any other assembly.


6.private protected:

it can only be accessed within the same class, and its derived class within the same assembly. 

Comments