Google News
logo
C# - Interview Questions
List down the access modifiers available in C#.
Following are the access modifiers available for general use :
 
Public : When an attribute or method is defined as public it can be accessed from any part of code.
 
Private : A private attribute or method can be accessed from within the class itself.
 
Protected : When a user defines a method or attribute as protected then it can be accessed only within that class and the one inheriting the class.
 
Internal : When an attribute or method is defined as internal then it will be accessed from that class at the current assembly position.
 
Protected Internal : When you define an attribute or method as protected internal, then it’s access restricted to classes within the current project assembly or different types defined by that class.
 
Moving ahead in C# Interview questions, let’s unfold some functionalities used in C#.
Advertisement