Explain About a class access specifiers and method access specifiers.



Explain About a class access specifiers and method access specifiers...

Answer / 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

More C Sharp Interview Questions

give suitable code for all login controls

1 Answers  


Define Virtual folder?

1 Answers   Arigo Infotech,


Is there any way to access private memebers of an object from another object?

4 Answers   TCS,


List down the fundamental oop concepts?

1 Answers  


What is Implementation inheritance and interface inheritance?

1 Answers  


Write a C# program to find the Factorial of n

1 Answers  


Difference between C++ and C#.net

19 Answers   Google, TCS, Wipro,


interface a { Method1() Method2() } class b: a { override Method1() override Method2() } what will happen & why?

5 Answers  


What is binding in c#?

1 Answers  


What Is The Smallest Unit Of Execution In .net?

1 Answers   Siebel Systems,


What is a console file?

1 Answers  


What is difference between ienumerable and list in c#?

1 Answers  


Categories