DriveUnsynchronized - BankAccount ba = new BankAccount Thread thread1 = new DepositThread(ba 100 Thread thread2 = new WithdrawThread(ba 100

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/** A driver to run unsynchronized threads that withdraw and deposit money to a bankaccount. */ import javax.swing.JOptionPane ; public class DriveUnsynchronized { public static void main(String[] args)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { BankAccount ba = new BankAccount() ; Thread thread1 = new DepositThread(ba, 100) ; Thread thread2 = new WithdrawThread(ba, 100) ; thread1.start() ; thread2.start() ; } }...
View Full Document

This note was uploaded on 09/29/2010 for the course COMPUTER S cps615 taught by Professor Pro during the Spring '10 term at Randolph College.

Ask a homework question - tutors are online