设计一个台灯类lamp其中台灯有灯泡这个属性java 怎么写

2020-08-16 教育 187阅读

你可以参照这个来

/** 
 * ClassName:Department 
 
 * 部门类
 */
public class Department {

private Integer departmentId;

private String departmentName;
public Integer getDepartmentId() {
return departmentId;
}
public void setDepartmentId(Integer departmentId) {
this.departmentId = departmentId;
}
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}

}
import java.util.Date;
/** 
 * ClassName:Employee 
 
 * 员工类
 */
public class Employee {

private Integer employeeId;

private String employeeName;

private Date hireDate;

private Department department;
public Integer getEmployeeId() {
return employeeId;
}
public void setEmployeeId(Integer employeeId) {
this.employeeId = employeeId;
}
public String getEmployeeName() {
return employeeName;
}
public void setEmployeeName(String employeeName) {
this.employeeName = employeeName;
}
public Date getHireDate() {
return hireDate;
}
public void setHireDate(Date hireDate) {
this.hireDate = hireDate;
}
public Department getDepartment() {
return department;
}
public void setDepartment(Department department) {
this.department = department;
}
}
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com