c#中Person

来源:百度知道 编辑:UC知道 时间:2024/06/01 15:50:22
public class Student: Person,IComparable<Student>中
Person是什么意思,需要导入什么命名空间么?

Person就是一个类,在这表示Student会继承类Person,也就是Person会成为Student类的父类

需不需要导入命名空间就不好说了,如果你的Student类与Person类在同一个命名空间下就不需要导入,直接用就可以,如果不是就要导入命名空间,你可以找到Person.cs(一般是这样命名的)文件,看看它里面的:
namespace Xxxx.Xxx
一行写的什么,其中“Xxxx.Xxx”就是Person的命名空间,就把它放到Student.cs的using中就可以了,类似:
using Xxxx.Xxx;

如果还不明白可以继续问我

Person是一个父类
student类继承了该类
是Icomparable需要导入命名空间吧

Person是一个基类
这句代码的意思是:
Student类继承Person类,然后实现IComparable接口
至于是否导入命名空间要看Person类的namespace而定

Person是个类 这句话的意思是Student这个类继承了Person这个类
也就是说Person是Student的父类
IComparable的意思是要实现 IComparable这个接口
至于你说的命名空间的问题。。在这句话里是看不出来的