employee.java

来自「大学java作业源程序」· Java 代码 · 共 51 行

JAVA
51
字号
package problem_9;
//Employee.java
//雇员类,继承人类
public class Employee extends Person{
	private String office;		//办公室信息
	private double wage;		//薪水
	private String hiredate;	//雇佣日期
	
	public Employee(String name, String address, String telephone, String email, String office, double wage, String hiredate){
		super(name, address, telephone, email);
		this.office = office;
		this.wage = wage;
		this.hiredate = hiredate;
	}
	
	//返回办公室信息
	public String getOffice(){
		return office;
	}
	
	//返回薪水
	public double getWage(){
		return wage;
	}
	
	//返回雇佣日期
	public String getHiredate(){
		return hiredate;
	}
	
	//设置办公室信息
	public void setOffice(String office){
		this.office = office;
	}
	
	//设置薪水
	public void setWage(double wage){
		this.wage = wage;
	}
	
	//设置雇佣日期
	public void setHiredate(String hiredate){
		this.hiredate = hiredate;
	}
	
	//重写toString()函数,打印雇员信息
	public String toString(){
		return super.toString().concat("办公室:" + office + "\n工资:" + wage + "\n受雇日期:" + hiredate + "\n");
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?