7段階目(IDが一致するか調べるメソッドを作ろう)

This commit is contained in:
s-sakiyama
2026-09-15 15:06:13 +09:00
parent d88468306f
commit b8aa7238f6
2 changed files with 32 additions and 0 deletions

View File

@@ -35,6 +35,19 @@ public class EmployeeData {
+ "\t" + this.password + "\t" + this.idDepartment;
}
public boolean isMatchId(String id) {
return getIdEmployee().equals(id);
}
public static boolean isMatchId(EmployeeData[] employees, String id) {
for (EmployeeData e : employees) {
if (e.isMatchId(id))
return true;
}
return false;
}
public String getIdEmployee() {
return idEmployee;
}
@@ -98,4 +111,5 @@ public class EmployeeData {
}
return true;
}
}