Example #1
0
 public void Deposit(double amount)
 {
     Console.WriteLine("{0}存款{1}", this.owner, amount);
     state.Deposit(amount);         //调用状态对象的Deposit()方法
     Console.WriteLine("现在余额为{0}", this.Balance);
     Console.WriteLine("现在帐户状态为{0}", this.state.GetType().ToString());
     Console.WriteLine("---------------------------------------------");
 }