Example Method Use
// Withdraw 100 from account2.
account2.withdraw( 100 );
/* If k is 1, deposit 200 into account1, otherwise deposit 200 into account2. */
if ( k == 1 ) a = account1;
else a = account2;
// Deposit 200 to Account a.
a.deposit( 200 );
// Let n be the next integer.
n = in.readInt();
// Output 300.
System.out.println(300);
Previous slide
Back to first slide
View graphic version