Exam 15: Inheritance

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

If a base class has a virtual function named print,and a pointer variable of that class is pointing to a derived object,then the code ptr->print ); calls

(Multiple Choice)
4.9/5
(34)

If a derived class Class2)has redefined a function from the base class Class 1),how can that derived function call the base class function if the function declaration is as follows? Void print );

(Multiple Choice)
4.9/5
(32)

Which of the following are not true

(Multiple Choice)
5.0/5
(43)

The derived class may define variables and member functions other than those that are in the base class.

(True/False)
4.8/5
(38)

Which is more general,the base class or the derive class.

(Short Answer)
4.8/5
(31)

Given a class A that derives from a class B that derives from a class C,when an object of class A goes out of scope,in which order are the destructors called?

(Multiple Choice)
4.9/5
(31)

If a base class has a non-virtual member function named print,and a pointer variable of that class is pointing to a derived object,then the code ptr->print ); calls

(Multiple Choice)
4.9/5
(37)

If a base class has public member functions that are not listed by a derived class,then these functions

(Multiple Choice)
4.8/5
(39)

Which of the following would correctly call the base class BaseClass)assignment operator from the derived class DerivedClass)assignment operator? DerivedClass& DerivedClass::operator =const DerivedClass& rightSide) { //what goes here? }

(Multiple Choice)
4.8/5
(40)

If two functions in the same scope)have the same name,but a different function signature,this means that the functions are __________.

(Short Answer)
4.9/5
(47)

Which is the correct way to tell the compiler that the class being declared ChildClass)is derived from the base class BaseClass)?

(Multiple Choice)
4.9/5
(36)

Given the following simplified classes, Class Pet { Public: Virtual void print); String name; Private: }; Class Dog: public Pet { Public: Void print); String breed; }; Dog vDog; Pet vPet; VDog.name="rover"; VDog.breed = "Collie"; Which of the following statements are not legal?

(Multiple Choice)
4.8/5
(41)

When deriving a class,you should

(Multiple Choice)
4.8/5
(31)
Showing 41 - 53 of 53
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)