业精于勤

导航

2012年4月18日

interface

摘要: interfaceIshirou{voidHunt();}interfaceIshicao{voidEatGrass();}abstractclassAnimal{publicabstractvoidEat();}classCat:Animal,Ishirou{publicoverridevoidEat(){Console.WriteLine("猫吃鱼");}publicvoidHunt(){Console.WriteLine("猫捉老鼠");}}classTiger:Animal,Ishirou{publicoverridevoidEat(){Cons 阅读全文

posted @ 2012-04-18 17:26 言午 阅读(385) 评论(0) 推荐(0) 编辑

抽象类 抽象方法 Message

摘要: //继承多态virtual虚方法override重写//抽向类(抽象方法)接口消息MessageSMSEmail...abstractclassMessage{publicstringsender;publicstringreceiver;publicstringcontent;publicDateTimesendtime;//publicvirtualvoidSend(){}publicabstractvoidSend();//抽象方法}classQQMsg:Message{publicoverridevoidSend(){}}classSMS:Message{publicoverridev 阅读全文

posted @ 2012-04-18 08:44 言午 阅读(267) 评论(0) 推荐(0) 编辑