I am trying to get out put which looks like this:
Code:
transaction# 0 Error: Tue Nov 16 16:47:15 EST 2010 bye : AMOUNT : 300.0
But this is what I get:
Code:
bye
transaction# 0 Error: Tue Nov 16 16:47:15 EST 2010 null : AMOUNT : 300.0
The code i use to implement this is written as such:
Code:
public String errorDescription() {
System.out.println("bye");
}
public String toString() {
return "Error: " + today + " "+ errorDescription() +" : AMOUNT : " + amount; }
its called here:
Code:
transactions[numTransactions] = new TransferTransaction(accountNumber, accountNumber, amt, balance); incrementTransactions();
Print out code:
Code:
for (int i=0;i<numTransactions;i++) {
System.out.println("transaction# " + i + " " +transactions[i].toString());
}
To better understand what i am trying to do. I am trying to print out the word bye in the correct order but instead it prints out on top and in its place a null is printed.