Lecture 3
Message invoking a method
BankAccount account = this.whichAccount( )
whichAccount( )
{
send atm readInt message
get number user types
return the right BankAccount
}
account =
that account
execution
flow: line 62 in Bank.java sends a whichAccount message
to itself. The method
whichAccount runs, returning a BankAccount (account1,
account2 or null), then work resumes at line 63 in
Bank.java