java 部门列表_员工表及员工部门表的简单java类
时间: 2024-02-24 11:55:30 浏览: 62
下面是一个简单的Java类,用于表示部门列表、员工表以及员工部门表:
```java
// 部门类
public class Department {
private int id;
private String name;
public Department(int id, String name) {
this.id = id;
this.name = name;
}
public int getId() {
return id;
}
public String getName() {
return name;
}
}
// 员工类
public class Employee {
private int id;
private String name;
private double salary;
public Employee(int id, String name, double salary) {
this.id = id;
this.name = name;
this.salary = salary;
}
public int getId() {
return id;
}
public String getName() {
return name;
}
public double getSalary() {
return salary;
}
}
// 员工部门类
public class EmployeeDepartment {
private int employeeId;
private int departmentId;
public EmployeeDepartment(int employeeId, int departmentId) {
this.employeeId = employeeId;
this.departmentId = departmentId;
}
public int getEmployeeId() {
return employeeId;
}
public int getDepartmentId() {
return departmentId;
}
}
```
以上代码只是一个简单的示例,你可以根据自己的需求进行修改和扩展。
阅读全文