01: import java.util.Random;
02: 
03: /**
04:    This program runs four threads that deposit and withdraw
05:    money from the same bank account. 
06: */
07: public class BankAccountThreadTest
08: {
09:    public static void main(String[] args)
10:    {
11:       BankAccount account = new BankAccount();
12: 
13:       DepositThread t0 = new DepositThread(account, 100);
14:       WithdrawThread t1 = new WithdrawThread(account, 100);
15:       DepositThread t2 = new DepositThread(account, 100);
16:       WithdrawThread t3 = new WithdrawThread(account, 100);
17: 
18:       t0.start();
19:       t1.start();
20:       t2.start();
21:       t3.start();
22:    }
23: }
24: