What happens if a derived class inherits publicly from a base class whose public and protected members are accessible?

Options

  • A. Base public members remain public in the derived class, and base protected members remain protected.
  • B. All base public members become private.
  • C. All base protected members become private.
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

A. Base public members remain public in the derived class, and base protected members remain protected.

Detailed Explanation

Correct Answer: Option A

Explanation:
With public inheritance, the base class public members remain public and the base class protected members remain protected in the derived class. Base class private members are not directly accessible in the derived class.