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


Please Help Members By Posting Answers For Below Questions

What is difference between ilist and list?

483


What are scriptable objects?

506


How many types of constructors are there?

508


Explain “static” keyword in c#?

479


What exactly is serverless?

422






What is regex c#?

484


Is c# still popular?

485


What is action c#?

486


How to add controls dynamically to the form using c#.net.

471


What is the use of delegates in c#?

474


Define constructor in c#.

511


What is args c#?

533


What is data dictionary in c#?

486


Name some properties of thread class.

551


How do I edit a dll file?

451