Which access modifier should you use for the GetData() …

An application includes a class named Person. The Person class includes a method named GetData.
You need to ensure that the GetData() method can be used only by the Person class or a class derived from
the Person class. Which access modifier should you use for the GetData() method?

An application includes a class named Person. The Person class includes a method named GetData.
You need to ensure that the GetData() method can be used only by the Person class or a class derived from
the Person class. Which access modifier should you use for the GetData() method?

A.
internal

B.
protected

C.
protected internal

D.
private

E.
public

Explanation:
protected – The type or member can be accessed only by code in the same class or struct, or in a class that
is derived from that class. http://msdn.microsoft.com/en-us/library/ms173121.aspx



Leave a Reply 0

Your email address will not be published. Required fields are marked *