Filters
Question type

Destructors are not inherited into the derived class.

A) True
B) False

Correct Answer

verifed

verified

If a base class has declared a function to be a virtual function,then does the derived class need to include the word virtual also?

Correct Answer

verifed

verified

The base class has everything that is in the derived class and more

A) True
B) False

Correct Answer

verifed

verified

A constructor of the base class is ____ inherited in the derived class is/is not)

Correct Answer

verifed

verified

Which of the following are true?


A) constructors of the base class are inherited in the derived class.
B) you may not call the base constructor from the derived class
C) You must define constructors in both the base and derived classes
D) all of the above
E) none of the above

F) A) and B)
G) A) and C)

Correct Answer

verifed

verified

If you have a copy constructor in the base class,but do not have a copy constructor for the derived class,then


A) you will have a syntax error
B) a copy constructor for the derived class is automatically created for you
C) you can not use pointer variables
D) the default constructor is used

E) A) and D)
F) B) and C)

Correct Answer

verifed

verified

What is another name for a child class?


A) derived class
B) sub class
C) descendent class
D) all of the above
E) none of the above

F) A) and B)
G) A) and C)

Correct Answer

verifed

verified

D

Using inheritance allows us to


A) eliminate duplicate code
B) make our classes more modular
C) use polymorphism
D) all of the above
E) none of the above

F) All of the above
G) B) and C)

Correct Answer

verifed

verified

The ability to associate multiple meanings to one function name using dynamic binding is called _________.

Correct Answer

verifed

verified

The copy constructor from the base class is not inherited into the derived class.

A) True
B) False

Correct Answer

verifed

verified

Given the following classes and code,what is the output of the last statement shown? Class Pet { Public: Virtual void print) ; String name; Private: }; Class Dog: public Pet { Public: Void print) ; String breed; }; Void Pet::print) { Cout << "My name is " << name; } Void Dog::print) { Pet::print) ; Cout << ",and my breed is a "<< breed << endl; } Pet pPtr; Dog dPtr; DPtr->name= "Rover"; DPtr->breed="Weiner"; PPtr= dPtr; PPtr->print) ;


A) My name is Rover,and my breed is a Weiner
B) My name is Rover
C) ,and my breed is a Weiner
D) nothing

E) A) and C)
F) All of the above

Correct Answer

verifed

verified

If the member variables in a base class are marked as private,can a derived class directly access those variables?

Correct Answer

verifed

verified

No

A derived class automatically gets all the member variables from the base class.

A) True
B) False

Correct Answer

verifed

verified

If the member variables of the base class are marked as protected,who can access those variables?

Correct Answer

verifed

verified

members,friends,and ...

View Answer

If you define a function in the derived class that has the same function signature as a function in the base class,this is known as


A) overloading
B) redefinition
C) overwriting
D) a syntax error

E) B) and C)
F) A) and B)

Correct Answer

verifed

verified

In order to tell the compiler to wait to decide which version of a function to use,you must precede the function declaration in the base class with the keyword


A) operator
B) friend
C) virtual
D) void

E) B) and D)
F) A) and B)

Correct Answer

verifed

verified

The ifstream class is derived from the __________ class.

Correct Answer

verifed

verified

If a base class has a public member function,and the derived class has a member function with the same name,but with a different parameter list,this function is said to be


A) overloaded
B) redefined
C) overwritten
D) a syntax error

E) B) and C)
F) B) and D)

Correct Answer

verifed

verified

A

C++ implements polymorphism by waiting until run-time to determine which version of a function to use.This is also known as ______________.

Correct Answer

verifed

verified

late or dy...

View Answer

Give a base class with at least one public member function,how many classes can redefine that member function?


A) 1
B) 0
C) all of them
D) none of the above

E) None of the above
F) A) and C)

Correct Answer

verifed

verified

Showing 1 - 20 of 53

Related Exams

Show Answer