What is the difference between protected and protected internal?

Answer Posted / anusha

Internal:
When Members of a class are declared as internal, then they can be accessed

1. within the class in which they are declared.

2. within the derived classes of that class available within the same assembly.

3. outside the class within the same assembly.

Protected:
When Members of a class are declared as protected, then they can be accessed

1. within the class in which they are declared.

2. within the derived classes of that class available within the same assembly.

3. within the derived classes of that class available outside the assembly.


Protected internal:
When Members of a class are declared as protected internal, then they can be accessed

1. within the class in which they are declared.

2. within the derived classes of that class available within the same assembly.

3. outside the class within the same assembly.

4. within the derived classes of that class available outside the assembly.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I get the ascii code for a character in c#?

565


Is c# int immutable?

504


What is asax file in c#?

568


Define a jagged array in c#?

482


How to reduce image resolution in C#?

627






Which property do we set on a Combo Box to display data on it prior to setting the DataSource ?

534


What are the value types in c#?

506


What are abstract classes in c#?

484


What is an xsd file?

501


How does return work in c#?

506


Which constructor is called first in c#?

515


How do you serialize in c#?

468


What is the data type for bit in c#?

472


What are boxing and unboxing?

517


Explain the difference between a namespace and assembly name in .net?

493