Use this space to put some text. Update this text in HTML

468x60 banner ad

Advertise with Us

Powered by Blogger.
Showing posts with label What are Access Modifiers in C-Sharp. Show all posts
Showing posts with label What are Access Modifiers in C-Sharp. Show all posts

Saturday, 5 March 2016

What are Access Modifiers in C-Sharp


Access modifier keywords used to specify declare accessibility of a member or a type.

1)      Access Modifiers

Public

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

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

      Protected

The type or member can be accessed only by code in the same class or struct, or in a class that is derived from that class.

      Internal

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

    Protected Internal

The type or member can be accessed by any code in the assembly in which it is declared, or from within a derived class in another assembly. Access from another assembly must take place within a class declaration that derives from the class in which the protected internal element is declared, and it must take place through an instance of the derived class type.