What are the access-specifiers available in c#?
Answer Posted / anupam dixit
1. Public: Any member declared public can be accessed from
outside the class.
2. Private: it allows a class to hide its member variables
and member functions from other class objects and function.
Therefore, the private member of a class is not visible
outside a class. if a member is declared private, only the
functions of that class access the member.
3. Protected: This also allows a class to hide its member
var. and member func. from other class objects and
function, except the child class. it becomes important
while implementing inheritance.
4. Internal: Internal member can be expose to other
function and objects. it can be accessed from any class or
method defined within the application in which the member
is defined
5. Protected Internal: it's similar to Protected access
specifier, it also allows a class to hide its member
variables and member function to be accessed from other
class objects and function, excepts child class, within the
application. used while implementing inheritance.
| Is This Answer Correct ? | 126 Yes | 23 No |
Post New Answer View All Answers
I need code to connect ohter systems in the LAN and i want to display my website image over there and i want explain as a admin through phone. So i need code to access other system using C-Sharp. Any one please help me.Please give me the code. Advace thanks.
In .NET which is the smallest unit of execution?
What is action c#?
What is the use of delegate?
What is tryparse?
Explain the difference between a namespace and assembly name in .net?
What is assembly manifest?
Which function is the entry point for a DLL in MS Windows 3.1?
What is the default scope of a class in c#?
Is double a decimal?
What is executereader in c#?
Does c# support parameterized properties?
What is the resgen.exe tool used for?
Give examples for reference types?
What is parsing?