salariedworker.java
来自「国外的数据结构与算法分析用书」· Java 代码 · 共 20 行
JAVA
20 行
/** A class for an Employee with a weekly salary. */
public class SalariedWorker extends Employee
{
/** Weekly salary of the Employee. */
int weeklySalary;
/** Constructor that initializes the name, address, and Employee number. */
public SalariedWorker(String n, String a, int e, int w)
{
super(n, a, e);
weeklySalary = w;
}
/** String representation of the Employee information and weekly salary. */
public String toString()
{
return super.toString() + "Employee salary: $" + weeklySalary + "\n";
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?