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
Is c# a keyword?
Explain the types of assemblies in .net?
What is var c#?
I was trying to use an out int parameter in one of my functions. How should I declare the variable that I am passing to it?
Explain the Different types of configuration files in .net?
Which attribute is used in order that the method can be used as webservice?
Can an abstract class have a constructor c#?
How big is an int in c#?
Which namespaces are necessary to create a localized application?
What is an enumerator c#?
Why do we need interface in c#?
What is int tryparse in c#?
Are constructors inherited c#?
How many constructors can a class have in c#?
What does f mean in c#?