Chapter 7: Poly-what-ism?
In This Chapter
Deciding whether to hide or override a base class method (so many choices!)
Building abstract classes — are you for real?
Declaring a method and the class that contains it to be abstract
Using ToString
, the class business card
Sealing a class from being subclassed
In inheritance, one class “adopts” the members of another. Thus I can create a class SavingsAccount
that inherits data members such as account id
and methods such as Deposit()
from a base class BankAccount
. That’s useful, but this definition of inheritance isn’t sufficient to mimic what’s going on out there in the business world.
A microwave oven is a type of oven, not because it looks like an oven but, rather, because it performs the same functions as an oven. A microwave oven may perform ...