我需要打印用户输入的员工的详细信息。到目前为止,我能得到的只是名字。任何人都可以帮我解决这个问题吗?
员工商店
public void add(Employee employee)
{
map.put(employee.getEmployeeName(), employee);
}
public Employee searchByName(String name)
{
System.out.println(name);
return map.get(name);
}
用法
EmployeeStore Store = new EmployeeStore();
Store.add(new Employee ("James O' Carroll", 18,"hotmail.com"));
Store.add(new Employee ("Andy Carroll", 1171,"yahoo.com"));
Store.add(new Employee ("Luis Suarez", 7,"gmail.com"));
Store.searchByName("James O' Carroll");