求助:一道让我头疼的C#小题!
1说出以下每个场景出错的准确原因?
假定Professor和Student都是实现ITeacher接口的类
场景一:
Professor p;
Student s=new Student();
ITeacher t;
t=s;
p=t;
//这里我感觉是错在p=t;一句但说不出到底为什么?
场景二:
Professor p=new Professor;
Student s;
ITeacher t=new Student();
s=t;
//?
场景三:
Professor p=new Professor();
Student s=new Student();
ITeacher t;
p=t;
//这个看来是p=t;错了
|
请发表评论