我有這個方法的問題。當用戶請求時,它不輸出正確的搜索。searchByEmail方法不起作用
這裏是我的代碼:
System.out.println("Search by Email.");
Employee employeeSearchEmail = MenuMethods.userInputByEmail();
Store.searchByEmail(employeeSearchEmail.getEmployeeEmail());
public Employee searchByEmail(String employeeEmail) {
for (Employee employee : map.values()) {
System.out.println(employee);
map.equals(getClass());
map.equals(employee.getEmployeeEmail());
employee = new Employee(employeeEmail);
;
return employee;
}
return null;
}
public static Employee userInputByEmail() {
// String temp is for some reason needed. If it is not included
// The code will not execute properly.
String temp = keyboard.nextLine();
Employee e = null;
System.out.println("Please enter the Employee Email:");
String employeeEmail = keyboard.nextLine();
// This can use the employeeName's constructor because java accepts the
// parameters instead
// of the name's.
return e = new Employee(employeeEmail);
}
當我這樣做,它打印出整個商店。 – Pendo826 2012-07-21 13:24:46
整店意味着所有員工數據 – 2012-07-21 13:26:59
嗯,是所有的員工。 – Pendo826 2012-07-21 13:27:33