title: Adding a date historylist for deposit and withdraw in bankaccount java
body: <p>I've been banging my head for a while now with this problem. I want to add a historylist of withdrawals and deposits to my bankaccount program. I made a subclass, Transaction to my superklass, Account with these methods:</p>
  
  <pre><code>import java.util.*;
  
  
  public class Transaction extends Account{
  private double amount;
  
  public String addDeposit() {
      Account newDep = new Account();
      Date date = new Date();
      newDep.deposit(amount); 
      return date + "\tIN: " + amount + "\t" + getBalance();  
  }
  
  public String addWithdraw() {
      Account newWith = new Account();
      Date date = new Date();
      newWith.withdraw(amount);   
      return date + "\tUT: " + amount + "\t" + getBalance();  
  }
  
  public String getTransactionHistory()
  {
      return;
  }
  }
  </code></pre>
  
  <p>I would like to add an if-statement that prints out if its a withdrawal or deposit. But how do I do that? I'm not even sure this is the easiest way to go to put the transaction in another subclass.</p>