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 beused only by the Person class and not by any 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 beused only by the Person class and not by any class
derived from the Person class.
Which access modifier should you use for the GetData() method?

A.
Public

B.
Protected Internal

C.
Internal

D.
Private

E.
Protected



Leave a Reply 1

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