We will extend our single-level class hierarchy to multiple levels. A BankAccount inherits from Asset. A bank account can be one of two types: savings or checking. Therefore, we can say the following:
·A bank account “is an” asset.
·A savings account “is a” type of bank account.
·A checking account “is a” type of bank account.
Thus, we could add two more classes, called SavingsAccount and CheckingAccount, to our class hierarchy to represent these additional real-life entities. This is shown in the UML diagram here:
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
We will extend our single-level class hierarchy to multiple levels. A BankAccount inherits from Asset. A bank account can be one of two types: savings or checking. Therefore, we can say the following:
·A bank account “is an” asset.
·A savings account “is a” type of bank account.
·A checking account “is a” type of bank account.
Thus, we could add two more classes, called SavingsAccount and CheckingAccount, to our class hierarchy to represent these additional real-life entities. This is shown in the UML diagram here: