QUESTIONS AND CORRECT ANSWERS
In an inheritance situation, you cannot pass arguments to a base class constructor in the derived class.
T/f - correct answer false
You can have more than one class derived from a base class. T/f - correct answer true
A derived class can be also be a base class if another class is derived from it. T/f - correct
answer true
Can you use a derived class's constructor header to pass arguments to a base class constructor? -
correct answer yes
A member function of a derived class may not have the same name as a member function of a base
class. T/f - correct answer false
If you want a public class member function of a base class in a derived class, the corresponding
function in the derived class must have the same name, number, and type of parameters. What is this
called? - correct answer function redefinition
What does static binding relate to? Compile or run-time? - correct answer compile time
Can base class pointers hold derived class objects? - correct answer yes
If you have a derived class and it attempts to override a final member of a base class, will it compile?
- correct answer no, derived classes can't override final member functions
What are the three access specifiers? - correct answer public, protected, private
What's the mechanism that allows you to create new classes based on existing classes? - correct
answer inheritance
, Can you add more functions to a derived class? - correct answer yes
Are private members of the base class accessible by any derived class? - correct answer no,
they're always inaccessible to derived classes
Which one is called first, the constructor of a base class or the constructor of a derived class? - correct
answer base class
Do we expect virtual functions to be overridden in the derived class? - correct answer yes
What's the term that means the ability to take on many forms? - correct answer polymorphism
When the computer binds a memory function call with a version of the function that resides in the
same class as the call itself, what type of binding is done? - correct answer static
What type of binding is done on virtual functions? - correct answer dynamic / run-time
If you have a protected base class and a derived class, what type of access specifier will the derived
class members be? - correct answer protected
What's it called when member functions behave differently depending on which object performed the
call? - correct answer polymorphism
C++ introduced this keyword to help prevent errors when overriding virtual functions. What's this
keyword? - correct answer override
What's the ability to combine data with operations or methods in a single unit? - correct
answer encapsulation
Given a sample set of code, choose one that makes public members of a base class become members
of the derived class. - correct answer use the public filter