Access Modifier in .net class

Following are the access modifier in class of .net framework.

1. Public

Allow access to class member from any other class.

2. Private

Allow access to class member from same class only.

3. Protected

Allow access to class member from same class and inherited classes.

4. Internal

Allow access to the class member in same Assembly.

5. Protected Internal

Allow access to class member in same class,inherited classes and classes in same Assembly.

6. Static

Indicates member can be called without instantiating the class.

Comments

Popular posts from this blog

How to create Rest API(Web API) with ASP.NET Core 1.0

Creating PDF with ASP.Net MVC and RazorPDF

Solution: gulp is not recognized as internal or external command- Visual Studio