Q&A
Q1: | 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? |
A1: | Yes. As derivation continues, derived classes inherit the sum of all the functions and data in all their base classes. |
Q2: | Can a derived class make a public base function private? |
A2: | Yes, and it will then remain private for all subsequent derivations. |
Get Sams Teach Yourself C++ in 24 Hours, 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.