< previous page page_266 next page >

Page 266
Methods in the base class can be invoked by explicitly naming the function with the prefix of the base class name and two colons. For example, if Dog inherits from Mammal, Mammal's walk() method can be called with Mammal::Walk().
Q&A
Q Are inherited members and functions passed along to subsequent generations? If Dog derives from Mammal and Mammal derives from Animal does Dog inherit Animal's functions and data?
A Yes. As derivation continues, derived classes inherit the sum of all the functions and data in all their base classes.
Q Can a derived class make a public base function private?
A Yes, and it remains private for all subsequent derivation.

 
< previous page page_266 next page >

If you like this book, buy it!