difference between keyword internal and protected?
Answer Posted / dotnetasit
The keywords 'internal' and 'protected' are access modifiers.
If any member in a class is qualified with access
modifier 'internal', then it is friend to the current assembly
but not outside of it. This means any member or class(but not
the dervied classes) within the current assembly can access it.
On the other hand, any member qualified with access
modifier 'protected' can be accessed by derived classes only.
I also want to tell about the combined access
modifier 'protected internal'. Any member qualified with
access modifier 'protected internal' is accessible to the
derived classes as well as to any member or class within the
same assembly. So in a way, this combined modifier extends the
scope of 'internal'.
| Is This Answer Correct ? | 25 Yes | 2 No |
Post New Answer View All Answers
Can I define my own exceptions?
Write down the c# syntax to catch an exception
In gridview in editmode if we want to display information in one combobox based on
What is int tryparse in c#?
What is deadlock in c#?
What is managed code?
I was trying to use an out int parameter in one of my functions. How should I declare the variable that I am passing to it?
Difference between debug.write and trace.write?
What is orm in c#?
What is the difference between values and reference types?
What is default value of decimal c#?
Write a program in C# for checking a given number is PRIME or not.
What is the namespace for datatable in c#?
What is deferred execution in c#?
How do you serialize an object?