Class SynchronizedATM

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

public class SynchronizedATM extends ATM
This class demonstrates obtains a lock before access the BankAccount. That way, it always sees a consistent view of the account.
  • Constructor Details

  • Method Details

    • run

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

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