(String[] args)
| 3 | public class Intro { |
| 4 | |
| 5 | public static void main(String[] args) { |
| 6 | NoLockATM noLockATM = new NoLockATM(); |
| 7 | LockedATM lockedATM = new LockedATM(); |
| 8 | MyClass thread1 = new MyClass(noLockATM, lockedATM); |
| 9 | MyClass thread2 = new MyClass(noLockATM, lockedATM); |
| 10 | |
| 11 | thread1.start(); |
| 12 | thread2.start(); |
| 13 | |
| 14 | try { |
| 15 | Thread.sleep(1000); |
| 16 | } catch (InterruptedException e) { |
| 17 | // TODO Auto-generated catch block |
| 18 | e.printStackTrace(); |
| 19 | } |
| 20 | thread1.waitUntilDone(); |
| 21 | thread2.waitUntilDone(); |
| 22 | |
| 23 | System.out.println("NoLock ATM: " + noLockATM.getBalance()); |
| 24 | System.out.println("Locked ATM: " + lockedATM.getBalance()); |
| 25 | int v = thread1.delta + thread2.delta + 100; |
| 26 | System.out.println("Should Be: " + v); |
| 27 | System.out.println("Program terminating."); |
| 28 | } |
| 29 | |
| 30 | } |
nothing calls this directly
no test coverage detected