Java Reference
In-Depth Information
public Account
createSub(String name, String amt)
throws NumberFormatException
{
Account acct = new Account(name, owner, amt);
// Reduce the parent's unallocated funds.
balance = balance.subtract(acct.getTotal());
// Connect the accounts to each other.
acct.parent = this;
children.put(name, acct);
return acct;
} // createSub
/**
* Looks up and returns the account with the given name.
*/
public Account
getSub(String name)
{
return (Account) children.get(name);
} // getSub
} // class Accoun
The Umbrello UML modeller is an Open Source tool for creating the various
UML diagrams. You can find it at http://uml.sourceforge.net/
index.php . We also recommend their online documentation as a good brief
introduction to UML and to Umbrello. It can be found from the main Umbrel-
lo page, or directly at http://docs.kde.org/en/HEAD/kdesdk/umbrello/ .
12.13
E XERCISES
1. Imagine a public library. Carry out the CRC nomination process for a
system to track library members and the collection. What list of objects
do you come up with? What abstract classes do you find? Which did you
discard and why?
2. Extend the purpose of the library program to include generating mailings
to members with overdue materials. Did you add classes? Did you add
methods and/or members? To which classes did you add them?
Search WWH ::




Custom Search