Class ATM

java.lang.Object
edu.pdx.cs410J.net.ATM
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
SynchronizedATM

public class ATM extends Object implements Runnable
This class demonstrates how concurrent access to a bank account needs to be synchronized in order to guarantee the balance is always correct.
  • Field Details

  • Constructor Details

  • Method Details

    • run

      public void run()
      Perform each transaction on the account
      Specified by:
      run in interface Runnable
    • main

      public static void main(String[] args)
      Create a couple of accounts and have them all perform the same transactions, but in different orders.