In the implementation of the getMax() function in the PriQueue class, we need to read and write the variables “front” and “rear”, which are defined as protected members in the base class Queue. Are the functions in the derived class allowed to access the protected members in the base class?

In the implementation of the getMax() function in the PriQueue class, we need to read and write the variables “front” and “rear”, which are defined as protected members in the base class Queue. Are the functions in the derived class allowed to access the protected members in the base class?

Answers:
A.

Yes, always.

B.

No, never.

C.

Depending on if the members are virtual members or not.

D.

Depending on if the members are final members or not.

Answer. A.