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
What is the difference between malloc () and new?
What is lazy loading and eager loading in c#?
Can you inherit from multiple classes in c#?
Is java better than c sharp?
Are arrays immutable c#?
List the two important objects of ado.net and also list the namespaces that are commonly used in ado.net to aid in connection to a database.
Is and as keyword in c# net?
Can you declare struct members as protected?
What is array formula?
Is null or empty in c#?
What is verbatim string literal in c#?
What is the difference between hashtable and dictionary in c#?
What is the delegates in c#?
Why do we need escape characters?
What is the difference between method overriding and method overloading?