public static void deleteEmployee(int empId) {
Iterator<Employee> iterator = list1.iterator();
while (iterator.hasNext()) {
if (iterator.next().getEmpid() == empId) {
System.out.println("The name of whose details deleted is ::");
iterator.remove();
}
}
}
在这里,我试图根据员工 ID 从数组列表中删除节点。但在删除之前,我想显示特定员工的详细信息。我怎样才能做到这一点?