01: /**
02:    This program runs two threads that deposit and withdraw
03:    money from the same bank account. 
04: */
05: public class BankAccountThreadTester
06: {
07:    public static void main(String[] args)
08:    {
09:       BankAccount account = new BankAccount();
10:       final double AMOUNT = 100;
11:       final int REPETITIONS = 1000;
12: 
13:       DepositRunnable d = new DepositRunnable(
14:             account, AMOUNT, REPETITIONS);
15:       WithdrawRunnable w = new WithdrawRunnable(
16:             account, AMOUNT, REPETITIONS);
17:       
18:       Thread t1 = new Thread(d);
19:       Thread t2 = new Thread(w);
20: 
21:       t1.start();
22:       t2.start();
23:    }
24: }
25: