title: How do I use the transferTo() method to transfer money between accounts?
body: <p>I am supposed to Add the following method to allow BankAccounts to transfer money to another BankAccount. Where would I add this method to make sure it works for all BankAccounts, including SavingsAccount and CheckingAccount?</p>
  <p>The method im supposed to use is <em>transferTo(BankAccount destinationAccount, int transferAmount)</em></p>
  <pre><code>public class BankAccount {
  
  
  private String accountHolderName;
  private String accountNumber;
  private int balance;
  
  public BankAccount(String accountHolder, String accountNumber) {
      this.accountHolderName = accountHolder;
      this.accountNumber = accountNumber;
      this.balance = 0;
  }
  
  public BankAccount(String accountHolder, String accountNumber, int balance) {
      this.accountHolderName = accountHolder;
      this.accountNumber = accountNumber;
      this.balance = balance;
  }
  
  public String getAccountHolderName() {
      return accountHolderName;
  }
  
  public String getAccountNumber() {
      return accountNumber;
  }
  
  public int getBalance() {
      return balance;
  }
  
  // Update the balance by using the DollarAmount.Plus method
  public int deposit(int amountToDeposit) {
      balance = balance + amountToDeposit;
      return balance;
  }
  
  // Update the balance by using the DollarAmount.Minus method
  public int withdraw(int amountToWithdraw) {
      balance = balance - amountToWithdraw;
      return balance;
  }
  
  public int transferTo(BankAccount destinationAccount, int transferAmount) {
  
      return balance;
  
  }
  </code></pre>
  <p>}</p>