public void TransferTo(double amount, BankAccount3 another) { this.Withdraw(amount); another.Deposit(amount); /* * if (amount > balance) * { * Console.WriteLine("Cannot transfer the amount greater than balance"); * } * else * { * balance = balance - amount; * another.Deposit(amount); * Console.WriteLine("Transfer ${0} dollars to {1}'account:{2}", amount, another.AccountHolderName, another.AccountNumber); * } */ }
public new void TransferTo(double amount, BankAccount3 another) { balance = balance - amount; another.Deposit(amount); Console.WriteLine("Transfer ${0} dollars to {1}'account:{2}", amount, another.AccountHolderName, another.AccountNumber); }