Different Types of Access Modifiers

There are 5 different types of Access Modifiers we used in the .net framework. These are given below :

public :

This type or member can be accessed by any other code in the same assembly or another assembly that references it.

private :

This type or member can only be accessed by code in the same class or struct.

protected :

This type or member can only be accessed by code in the same class or struct, or in a derived class.

internal :

This type or member can be accessed by any code in the same assembly, but not from another assembly.

protected internal :

This type or member can be accessed by any code in the same assembly, or by any derived class in another assembly.


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: