Which access modifier should you use?

You are designing a class for an application. You need to restrict the availability of the
member variable accessCount to the base class and to any classes that are derived from the
base class.
Which access modifier should you use?

You are designing a class for an application. You need to restrict the availability of the
member variable accessCount to the base class and to any classes that are derived from the
base class.
Which access modifier should you use?

A.
Protected

B.
Private

C.
Public

D.
Friend



Leave a Reply 2

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


Carlos

Carlos

Shouldn’t it be “A. Protected”?