Consider the following inheritance in C++ class BASE: class BASE { int B1;…

Navodaya Vidyalaya Samiti 2022

Consider the following inheritance in C++ class BASE: class BASE { int B1; protected: int B2; public: ____ ____ void FUNB(); }; class DERIVED : public BASE { int D1; public: ____ ____ }; What will be the visibility modes of B2 and FUNB() in the derived class DERIVED?

  1. A.

    B2 → protected, FUNB() → public

  2. B.

    B2 → protected, FUNB() → protected

  3. C.

    B2 → public, FUNB() → public

  4. D.

    B2 → private, FUNB() → protected

Attempted by 501 students.

Sign up free to check your answer

Sign up free

Explore the full course: Bpsc

Loading lesson…