Java Reference
In-Depth Information
444
Figure 4
A Part of the Hierarchy of Swing User Interface Components
We will use a simpler example of a hierarchy in our study of inheritance concepts.
Consider a bank that offers its customers the following account types:
1. The checking account has no interest, gives you a small number of free
transactions per month, and charges a transaction fee for each additional
transaction.
2. The savings account earns interest that compounds monthly. (In our
implementation, the interest is compounded using the balance of the last day of
the month, which is somewhat unrealistic. Typically, banks use either the
average or the minimum daily balance. Exercise P10.1 asks you to implement
this enhancement.)
Search WWH ::




Custom Search