//Client program to test the BankAccount class // public class BankAccountTester { public static void main(String[] args) { //Testing Constructors BankAccount savings = new BankAccount(); BankAccount checking = new BankAccount(5000.0); System.out.println(savings + "\n" + checking); //Testing Mutators checking.withdraw(200.0); checking.withdraw(300.0); savings.transfer(500.0, checking); savings.deposit(500.0); System.out.println(); System.out.println(savings + "\n" + checking); //Testing Accessors System.out.println(); System.out.println("Savings : " + savings.getAccountNumber() + " & " + savings.getCurrentBalance()); System.out.println("Checking : " + checking.getAccountNumber() + " & " + checking.getCurrentBalance()); //Testing Overrides BankAccount account = savings.copy(); //clone() later System.out.println(); System.out.println("savings " + savings + "\n" + "account " + account); System.out.println("savings " + (savings == account ? "==" : "!=") + " account"); System.out.println("savings " + (savings.equals(account) ? "" : "!") + "equals account"); } }