INHERTIANCE

1.When the inheritance is private, the private methods in base class are __________ in the derived class (in C++).

A. Inaccessible
B. Accessible
C. Protected
D. Public

View Answer


2.Which design patterns benefit from the multiple inheritances?

A. Adapter and observer pattern
B. Code pattern
C. Glue pattern
D. None of the mentioned

View Answer


3.What is meant by multiple inheritance?

A. Deriving a base class from derived class
B. Deriving a derived class from base class
C. Deriving a derived class from more than one base class
D. None of the mentioned

View Answer


4.What will be the order of execution of base class constructors in the following method of inheritance.
class a: public b, public c {….};

A.  b(); c(); a();
B.  c(); b(); a();
C.  a(); b(); c();
D.  b(); a(); c();

View Answer


5.Inheritance allow in C++ Program?

A. Class Re-usability
B. Creating a hierarchy of classes
C. Extendibility
D. All of the above

View Answer


6. Can we pass parameters to base class constructor though derived class or derived class constructor?

A. Yes
B. No

View Answer


7.What are the things are inherited from the base class?

A. Constructor and its destructor
B. Operator=() members
C. Friends
D. All of the above

View Answer


8.Which of the following advantages we lose by using multiple inheritance?

A. Dynamic binding
B. Polymorphism
C. Both Dynamic binding & Polymorphism
D. None of the mentioned

View Answer






Also check :


Discussion


* You must be logged in to add comment.