ACCESS MODIFIERS IN C#
There are five access modifiers in C # :
1. PRIVATE 2. PUBLIC 3. PROTECTED 4. INTERNAL 5. PROTECTED INTERNAL
ACCESS MODIFIERS
|
ACCESSIBILITY
|
PRIVATE
|
ONLY WITH THE CONTAINING CLASS
|
PUBLIC
|
ANYWHERE…NO RESTRICTIONS
|
PROTECTED
|
WITHIN THE CONTAINING TYPES
AND THE TYPES DERIVED FROM THE
CONTAINING TYPE.
|
INTERNAL
|
ANYWHERE IN THE CONTAINING ASSEMBLY
|
PROTECTED INTERNAL
|
ANYWHERE IN THE CONTAINING ASSEMBLY AND FROM WITHIN
THE DERIVED CLASS IN ANY OTHER ASSEMBLY.
|