Review Questions

1: What does a derived class inherit from a base class?
2: What doesn't a derived class inherit from a base class?
3: Suppose the return type for the BankAccountD::operator=() function were defined as BankAccountD instead of BankAccountD &. What effect, if any, would that have?
4: In what order are class constructors and class destructors called when a derived class object is created and deleted?
5: If a derived class doesn't add any data members to the base class, does the derived class require constructors?
6: Suppose a base class and a derived class both define a method of the same name and a derived class object invokes the method. What method is called?
7: When does a derived class have to define an assignment operator? ...

Get The Waite Group's C++ Primer Plus, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.