static void Main(string[] args) { BankAccount bankAccount = new BankAccount(100, "Ivan"); bankAccount.Notify += DisplayMessage; bankAccount.Add(20); bankAccount.Take(30); }
public void TransferFundsTo(BankAccount otherAccount, double amount) { if (otherAccount is null) { throw new ArgumentNullException(nameof(otherAccount)); } Withdraw(amount); otherAccount.Add(amount); }