using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace 面向对象练习
{
public interface Cadre
{
string Post
{
get;
}
}
public class Teacher
{
string name;
string sex;
int age;
string title;
string address;
int tel;
public Teacher() { }
public Teacher(string name, string sex, int age, string title, string address, int tel)
{
this.name = name;
this.sex = sex;
this.age = age;
this.title = title;
this.address = address;
this.tel = tel;
}
public void Display()
{
Console.WriteLine( "姓名:{0},性别:{1}年龄:{2}职称:{3}地址:{4}电话:{5}",name,sex ,age ,title ,address ,tel );
}
}
public class Teacher_Cadre : Teacher, Cadre
{
public Teacher_Cadre(string name, string sex, int age, string title, string address, int tel)
: base(name,sex, age, title, address, tel)
{
}
public string Post
{
get { return "经理:"; }
}
public void Show()
{
Console.Write("职务:{0}",Post);
Display();
}
static void Main(string[] args)
{
Teacher_Cadre tom = new Teacher_Cadre("tom","男",20,"经理","广东",123456);
tom.Show();
}
}
}