What are the access-specifiers available in c#?
Answer Posted / md eqbal ansari
C# provide five access specifiers , they are as follows :
public, private , protected , internal and protected
internal .
public :
public is the most common access specifier in C# . It can
be access from anywhere, that means there is no restriction
on accessibility. The scope of the accessibility is inside
class as well as outside. The type or member can be
accessed by any other code in the same assembly or another
assembly that references it.
private :
The scope of the accessibility is limited only inside the
classes or struct in which they are declared. The private
members cannot be accessed outside the class and it is the
least permissive access level.
protected :
The scope of accessibility is limited within the class or
struct and the class derived (Inherited )from this class.
internal :
The internal access modifiers can access within the program
that contain its declarations and also access within the
same assembly level but not from another assembly.
protected internal :
Protected Internal member can be accessed as a Internal
member within the assembly and as a protected member
outside the assembly.
| Is This Answer Correct ? | 18 Yes | 5 No |
Post New Answer View All Answers
What are functions c#?
What are the string functions in c#?
Which framework is best for desktop application?
What is the difference between a method and a property?
User's session is explicitly killed by which method ?
Why to use “finally” block in c#?
What does using system mean in c#?
What are the boolean data types in c#?
Differentiate between dataset and datareader?
What are the various components in crystal reports?
How long has c# been around?
What is parsing?
What is the max value of int32 in c#?
What is a struct in C#?
What is use of singleton class in c#?