Menu ▼



Posted By :
avatarmrkraju
Total Views : 538

Access specifiers(or access modifiers) in object oriented programming

Access specifiers(or access modifiers) are used to set the accessibility of classes, methods and variables.

Types of modifiers
  • Public
  • Private
  • Protected
  • Internal
  • Protected Internal

Public
Can be accessible outside the class (anywhere) in the same assembly or another assembly.

Private
Accessible only in the same class.

Protected
Accessible in the same class or in a derived class of that class.

Internal
Accessible anywhere in the code with in the assembly. But not accessible in another assembly.

Protected Internal
Accessible anywhere in the code with in the assembly. And accessible only in derived class in another assembly.






comments powered by Disqus


Search dotnetlearners.com