What is access modifier.


1. Public :-
        A public member is accessible from any where. This is the least restrictive access modifier.

2. Private :-
         A private member is accessible only from within the same class. Not even derived classes can access it.

3. Protected :-
          A protected member is accessible from within the class and all derived classes. No access from the outside is permitted.

4. Internal :-
          An internal member is accessible from within any part of the same Microsoft .Net based assembly. You can think of it as public at the assembly level and private from outside the assembly.

5. Protected Internal :-
           An internal protected member is accessible from within the current assembly or from within types derived from the containing class.

Share

& Comment

0 comments:

Post a Comment

 

Copyright © 2019 HART™ is a registered trademark.