adspace


Explain About a class access specifiers and method access specifiers.

Answer Posted / Aditya Kumar

Class access specifiers determine the visibility of a class within the code. There are four types of class access specifiers in C#:
1. Public: The class can be accessed from any other class or namespace.
2. Private: The class can only be accessed within the same namespace or file.
3. Protected: The class can only be accessed within the same namespace or by derived classes.
4. Internal: The class can only be accessed within the same assembly.nMethod access specifiers determine the visibility of a method within the code. There are four types of method access specifiers in C#:
1. Public: The method can be accessed from any other class or namespace.
2. Private: The method can only be accessed within the same class.
3. Protected: The method can only be accessed within the same class or by derived classes.
4. Internal: The method can only be accessed within the same assembly.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why can't we use a static class instead of singleton?

954


What is an abstract class c#?

969


What is expression tree in c#?

998


How to assign Null value to Var?

1063


How do you inherit a class into other class in c#?

995


Which namespaces are necessary to create a localized application?

1142