public Transaction(String transaction){
  String[] a=transaction.split("\\s+");
  who=a[0];
  when=new Date(a[1]);
  amount=Double.parseDouble(a[2]);
  if (Double.isNaN(amount) || Double.isInfinite(amount))   throw new IllegalArgumentException("Amount cannot be NaN or infinite");
}

public Transaction ( String transaction ) { String [ ] a = transaction . split ( "\\s+" ) ; who = a [ 0 ] ; when = new Date ( a [ 1 ] ) ; amount = Double . parseDouble ( a [ 2 ] ) ; if ( Double . isNaN ( amount ) || Double . isInfinite ( amount ) ) throw new IllegalArgumentException ( "Amount cannot be NaN or infinite" ) ; }
initializes a new transaction by parsing a string of the form name date amount .
