employee.cs
来自「this is a good book for the visual c#」· CS 代码 · 共 60 行
CS
60 行
// Fig. 10.9: Employee.cs
// Abstract base class for company employees.
using System;
namespace Employees
{
public abstract class Employee
{
private string firstName;
private string lastName;
// constructor
public Employee( string firstNameValue,
string lastNameValue )
{
FirstName = firstNameValue;
LastName = lastNameValue;
}
// property FirstName
public string FirstName
{
get
{
return firstName;
}
set
{
firstName = value;
}
}
// property LastName
public string LastName
{
get
{
return lastName;
}
set
{
lastName = value;
}
}
// return string representation of Employee
public override string ToString()
{
return FirstName + " " + LastName;
}
// abstract method that must be implemented for each derived
// class of Employee to calculate specific earnings
public abstract decimal Earnings();
} // end class Employee
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?