.........
来源:互联网 发布:腾讯云数据可视化 编辑:程序博客网 时间:2024/05/21 21:45
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");
//}
}
}
- 程序员
- 程序员?
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 程序员
- 学习
- 今天运行的一段代码 总是出错 烦死了
- 面向FLASH的开发
- 面向照相机的开发
- BREW中语音与短信的开发
- .........
- 求直线和圆的关系 c#
- xmlbeans 使用 以及 java.io.IOException CreateProcess error=2错误处理(转)
- 呵呵
- Java中的继承与多态
- 在GridView中针对鼠标单击的某一独立单元格进行编辑
- 存储过程详细介绍
- 获取页面的所有TextBox的值
- 卸载以前版本的 Visual Studio 2005(步骤)