using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication4
{
class Person
{
private string name;
private int age;
public Person(string name, int age)
{
this.name = name;
this.age = age;
}
public void PersonDisp()
{
Console.WriteLine("姓名:"+name);
Console.WriteLine("年龄:"+age);
}
}
class Employee : Person
{
private string department;
private float salary;
public Employee(string department, float salary, string name, int age)
: base(name, age)
{
this.department = department;
this.salary = salary;
}
public new void PersonDisp()
{
base.PersonDisp();
Console.WriteLine("所在部门是:" + department);
Console.WriteLine("工资是:" + salary);
}
//public void EmployeeDisp()
//{
// Console.WriteLine("所在部门是:"+department);
// Console.WriteLine("工资是:"+salary);
//}
}
class Program
{
public static void Main()
{
//Show(null);
//Show("");
//Show(1);
//Console.Read();
Employee employee = new Employee("开发部",8000,"李宁",25);
employee.PersonDisp();
//employee.EmployeeDisp();
Console.Read();
}
//static void Show(Object o)
//{
// Console.WriteLine("Object");
//}
//static void Show(String s)
//{
// Console.WriteLine("String");
//}
}
}