Q1_20251108152245.webp
S

Q1_20251108152245.webp

  • Media owner Shoko91
  • Ngày thêm
getSalary(): double
.getDepartment(): String
.setName(n: String): void
.setSalary(s: double): void
.setDepartment(d: String): void
compareTo(other: Employee): int
.toString(): String
Base on given class diagram, create all interface and class
1. Class Employee
⚫ Declare the fields of the class.
⚫
Constructor: initialize the fields with values.
⚫
Getter methods for the fields.
Setter methods for the fields.
int compareTo(Employee other): defines the natural order by name (case-insensitive).
String toString(): return a string in the specified format id-name-salary-department
2. Interface Employee Management
⚫ void add(Employee e); - add a new employee.
void update(Employee e);-replace an existing employee by ID.
• List<Employee> listAll(); return an unmodifiable or copied list of employees.
• List<Employee> sortByName(); return an unmodifiable or copied list of employees ordered
by name.
3. Class InMemoryEmployee Management
• Declare the fields of the class.
⚫ void add(Employee e)
3 of 4
Paner No: 1
Zoom
+ 100%
Close
Chưa có bình luận nào.

Thông tin

Category
PRO192
Thêm bởi
Shoko91
Ngày thêm
Lượt xem
2,907
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom