📄 employee.java
字号:
/**
* This class models an Employee.
*
* @author author name
* @version 1.0.0
*/
public class Employee extends Person {
/* Salary of the employee */
private double salary;
/**
* Constructs an <code>Employee</code> object.
*
* @param initialName the name of the employee.
* @param initialAddress the address of the employee.
* @param initialSalary the salary of the employee.
*/
public Employee (String initialName, String initialAddress,
double initialSalary) {
super(initialName, initialAddress);//In Java, the super call in constructors must always be the first statement.
salary = initialSalary;
}
/**
* Returns the salary of this employee.
*
* @return the salary of this employee.
*/
public double getSalary() {
return this.salary;
}
/**
* Modifies the salary of this employee.
*
* @param newSalary the new salary.
*/
public void setSalary(double newSalary) {
salary = newSalary;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -