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