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 a collection class in c#?
How big is an int16?
Why are strings immutable in c#?
how background thread access to ui control?
What are Uses of CLR
Why ienumerable is used in c#?
What is using in c#?
What is difference between abstract class and interface in c#?
What is marshalling and what are different kinds of marshalling?
Why do we overload constructors?
What is mean by c#?
Give 2 scenarios where static constructors can be used?
What is an array of arrays called?
What is difference between yielding and sleeping?
What's the difference between System.String and System..StringBuilder in C#?