5 years ago in C++ Inheritance

Which of the following is false with respect to inheritance?

[A] When a base class is privately inherited,public members of the base class become private members of the derived class
[B] When a base class is publicly inherited,public members of the base class becomes public members of derived class
[C] When a base class is privately inherited,a private member of base class becomes private member of derived class
[D] When a base class is publicly inherited protected members of base class becomes protected members of derived class
Loading...
Next Question

Overall Stats

Attempted 240
Correct 45
Incorrect 83
Viewed 112

Answers

Guest
Guest
Ayush Bansal - 4 years ago

ow can you access private members of base class because private members can not be inherited

Vishal Tripathi - 5 years ago

when a bass class is privately inherited ,public and protected will come privately in derived class.

Guest - 5 years ago

all are true

Katreen Ebraheem
Katreen Ebraheem - 2 days ago

Katreen Ebraheem from Egypt is saying When a base class is publicly inherited,public members of the base class becomes public members of derived class is correct answer

alvin
alvin - 1 month ago

alvin from Delhi, India is saying When a base class is privately inherited,a private member of base class becomes private member of derived class is correct answer

Related Questions

Choose most appropriate statement

  • [A] An abstract base class can have pure virtual destructor
  • [B] An abstract base class can have only virtual destructor
  • [C] An abstract base class can have non virtual destructor
  • [D] An abstract base class cannot have destructor

The conversion from basic data to class type can be done by .......

  • [A] Writing constructor
  • [B] Is not possible
  • [C] overloaded casting operator
  • [D] object of a class

When a base class pointer points to derived class object?

  • [A] It can access only base class members
  • [B] It can access only derived class members
  • [C] Both base class & derived class members
  • [D] None

Which design patterns benefit from the multiple inheritance?

  • [A] Adapter and observer pattern
  • [B] Code pattern
  • [C] Glue pattern
  • [D] None of the mentioned

If a base class member access is public, and an inherited class accesses specifier is private, which of the following statement is true ?

  • [A] The base class member can be accessed by derived class objects
  • [B] The base class members cannot be accessed by the derived class members
  • [C] The derived class members can be accessed by the base class objects
  • [D] None of above