public class Person
{
protected string name;
protected string sex;
protected int age;
public string Name
{
get{return name;}
set{name=value;}
}
public string Sex
{
get{return sex;}
set{sex=value;}
}
public string Age
{
get{return age;}
set{age=value;}
}
public Person()
{
}
public Preson(string sName,string sSex,int iAge)
{
this.name=sName;
this.sex=sSex;
this.age=iAge;
}
}
public class Student:Person
{
private string sNO;
private string sProfession;
public string SNO
{
get{return sNO;"}
set{sNO=value;}
}
public string Profession
{
get{return sProfession;}
set{sProfession=value;}
}
}
public class Teacher:Person
{
private string _title;
private string _departmart;
public string Title
{get{return _title;}
set{_title=value;}
}
public string Department
{get{return _department;}
set{_department=value;}
}
}
温馨提示:答案为网友推荐,仅供参考