Access Modifiers
C# KeywordsIndicate The Accessibility Scope
1. Private
2. Private Protected
3. Protected
4. Internal
5. Protected Internal
6. Public
From
Less
Accessible
To
Wider
6.
Namesp
ace
C# Keywords IndicateThe Accessibility Scope
What You Can Write Inside
Namespace ?
1. Class
2. Struct
3. Interface
4. Enum
Access Modifier Allowed Inside
Namespace ?
1. Internal [Default]
2. Public
7.
Class Or
Struct
C# KeywordsIndicate The Accessibility Scope
What You Can Write Inside The Struct Or Class
1. Attributes [Fields] => Member Variable
2. Functions [Constructor , Getter Setter , Method]
3. Properties [Full Property , Automatic Property , Indexer]
4. Events
8.
Class Or
Struct
C# KeywordsIndicate The Accessibility Scope
Access Modifier Allowed
Inside Struct?
1. Private [Default]
2. Internal
3. Public
Access Modifier Allowed
Inside Class?
1. Private [Default]
2. Private Protected
3. Protected
4. Internal
5. Protected Internal
6. Public
9.
Interfa
ce
C# Keywords IndicateThe Accessibility Scope
What You Can Write Inside The Interface ?
1. Signature For Property => C# 7.0
2. Signature For Method => C# 7.0
3. Default Implemented Method => C# 8.0 Feature .Net Core 3.1 [2019]
10.
Enum
An enum typeis a special data type that enables for a variable to be a set
of predefined constants
Struct
â Value Type
âSupport Encapsulation and
Overloading in Polymorphism
â Doesnât Support Inheritance
â 3 Access Modifier Allowed
Inside It
â If You Defined a user defined
Constructor , Compiler Will
always Generate
Parameterless Constructor