예제 #1
0
        static void Main(string[] args)
        {
            Monkey m = new Monkey();
            Pigeon p = new Pigeon();
            Lion l = new Lion();

            Feeder f = new Feeder();
            f.Name = "小李";

            f.FeedMonkey(m);	//喂猴子
            f.FeedPigeon(p);	//喂鸽子
            f.FeedLion(l);		//喂狮子

            Console.ReadKey();
        }
예제 #2
0
파일: Program.cs 프로젝트: shouzhuo1/CSharp
        static void Main(string[] args)
        {
            Monkey m = new Monkey();
            Pigeon p = new Pigeon();
            Lion   l = new Lion();

            Feeder f = new Feeder();

            f.Name = "小李";

            f.FeedMonkey(m);    //喂猴子
            f.FeedPigeon(p);    //喂鸽子
            f.FeedLion(l);      //喂狮子

            Console.ReadKey();
        }
예제 #3
0
 //ιʨ��
 public void FeedLion(Lion l)
 {
     l.eat();
 }
예제 #4
0
 //ιʨ×Ó
 public void FeedLion(Lion l)
 {
     l.eat();
 }