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 can be done with c#?

527


What are variables in c#?

600


What is orm in c#?

566


What is difference between continue and break in c#?

580


What is difference between ilist and list?

568






What are annotations in c#?

607


Is for loop faster than foreach?

616


What are the properties of string?

576


What is namespace in oop?

596


Define c# i/o classes?

613


Are there constructors in c sharp?

651


Do extension methods have to be static?

627


What is data type c#?

586


What is session management in c#?

630


Is int reference type c#?

594