1 22 package test.patterns.readwritelock; 23 27 public class ProcessTransaction implements Runnable  28 { 29 private Account account; 30 private float amount; 31 32 public ProcessTransaction(Account account,float amount) 33 { 34 this.account=account; 35 this.amount=amount; 36 } 37 public void run() 38 { 39 if (amount>0) account.credit(amount); 40 else account.debit(amount*-1); 41 } 42 } 43 44 | Popular Tags |