using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace 观察者模式{ class Program { static void Main(string[] args) { Cat ca = new Cat();//实例化主题子类 Master s = new Master(ca); Mouse mo = new Mouse(ca); Child ch = new Child(ca); ca.Shout(); Console.ReadKey(); } }}
评论