The number of times each individual object has been used.
(If this is not clear, look at the class definition again to see that
the variable useCount
is part of each object,
and that each object has its own method incrementUse()
which increments its own variable.)
main()
Here is a main()
that shows these ideas:
class CheckingAccountTester { public static void main( String[] args ) { CheckingAccount bobsAccount = new CheckingAccount( "999", "Bob", 100 ); CheckingAccount jillsAccount = new CheckingAccount( "111", "Jill", 500 ); bobsAccount.processCheck( 50 ); bobsAccount.processDeposit( 150 ); bobsAccount.processCheck( 50 ); jillsAccount.processDeposit( 500 ); jillsAccount.processCheck( 100 ); jillsAccount.processCheck( 100 ); jillsAccount.processDeposit( 100 ); bobsAccount.display(); jillsAccount.display(); } }
How may times has Bob's account been used?
How may times has Jill's account been used?