标签:style blog http ar os sp strong on div
今天在云和学院学了很多,我这次只能先总结一下C#中的虚方法和抽象的运用。
理论:

定义一个People的父类,包括Name,Gender,Age,和一个PeoHi 的虚方法,定义两个子类Teacher,包括Year,Salary两个属性和一个PeoHi方法;子类Student,包括StadyNum和一个PeoHi方法.

定义子类Teacher(Student子类 与Teacher定义方法相同,这里不在介绍)

在Main函数里输出

输出结果

抽象方法,定义一个父类Person,和子类Chinese


好了,今天就先写到这里了,下次再继续。加油!
标签:style blog http ar os sp strong on div
原文地址:http://www.cnblogs.com/ysaw/p/4111553.html