What are Access Modifiers/Specifiers in C#

11 Mar 2014, 05:25 AM

Access Modifiers defines the scope of the member or type. The keywords used to specify the declared accessibility of a member or a type. There are 5 types of access modifiers that can be used in c#

  1. public

    It specifies that everyone can access the member or type. It can be access from the anywhere even from the outside the namespace.

  2. protected

    It specifies that only containing class and child class can access it. It becomes very important while implementing inheritance.

  3. internal

    It specifies that the class and member can be access only with in the same assembly.

  4. protected internal

    It specifies that the access is limited to the current assembly or the child class that is derived from the containing class.

  5. private

    It specifies that the only containing type can access it.

Related Contents

15 May 2014, 08:07 AM
C#, LINQ, List
15 May 2014, 07:54 AM
C#, LINQ, List
29 Apr 2014, 03:07 AM
C#, Generic
About
Explains access modifies in c#

Date Posted 11 Mar 2014, 04:14 AM
Author Brainy Solutions
Views 719
;