What are the access-specifiers available in c#?
Answer Posted / soundararajan rajendran
Public
Protected
Internal(Known as "Friend" in C++)
Private
Protected or Internal
Public:
Any one can access the member functions and variables.
Protected:
Only child classes or classes that derive from this can
access.
Internal:
Classes within the same assembly can access but not by
child classes.
Private:
Accessible within the same class only.
Protected or Internal:
Member functions and variables can be accessed from the
classes which are in the same assembly Or can be accessed
from the the child classes.
| Is This Answer Correct ? | 19 Yes | 7 No |
Post New Answer View All Answers
How to get the sum of last 3 items in a list using lambda expressions?
What basic steps are needed to display a simple report in crystal?
What is difference between abstract class and interface in c#?
How can you prevent escaping on backslashes in C# with string definitions?
Why does dllimport not work for me?
Can destructors have access modifiers?
Is a dll an assembly?
Explain the types of assemblies in .net?
If the interface in c# only contains the declaration of the methods and we need to define those methods in the class, then why we use the interface?
What are the different types of assembly?
What namespace is list in c#?
Is post back in c#?
How many parameters can a method have c#?
What is sqladapter c#?
Why do we overload constructors?