Вопрос пользователя:
Ответ нейросети:
public class Department { private String title; private List<Employee> employees;
public Department(String title) {
this.title = title;
this.employees = new ArrayList<>();
}
public void addEmployee(Employee employee) {
employees.add(employee);
}
public void removeEmployee(Employee employee) {
employees.remove(employee);
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public List<Employee> getEmployees() {
return employees;
}
}
public class Employee { private String fullName; private String position; private Department department;
public Employee(String fullName, String position, Department department) {
this.fullName = fullName;
this.position = position;
this.department = department;
}
public String getFullName() {
return fullName;
}
public void setFullName(String fullName) {
this.fullName = fullName;
}
public String getPosition() {
return position;
}
public void setPosition(String position) {
this.position = position;
}
public Department getDepartment() {
return department;
}
public void setDepartment(Department department) {
this.department = department;
}
}
Напишите нам, если в вопросе есть ваши персональные данные ([email protected])
Обратите внимание: ответы, предоставляемые искусственным интеллектом, могут не всегда быть точными. Не рассчитывайте на них в критически важных областях, таких как медицина, юриспруденция, финансы или в вопросах, связанных с безопасностью. Для важных решений всегда обращайтесь к квалифицированным специалистам. Администрация сайта не несет ответственности за контент, сгенерированный автоматически.