public Transaction(String who,Date when,double amount){
  if (Double.isNaN(amount) || Double.isInfinite(amount))   throw new IllegalArgumentException("Amount cannot be NaN or infinite");
  this.who=who;
  this.when=when;
  this.amount=amount;
}

public Transaction ( String who , Date when , double amount ) { if ( Double . isNaN ( amount ) || Double . isInfinite ( amount ) ) throw new IllegalArgumentException ( "Amount cannot be NaN or infinite" ) ; this . who = who ; this . when = when ; this . amount = amount ; }
initializes a new transaction from the given arguments .
