Day1、7段階目完了

This commit is contained in:
m-endo
2026-09-18 16:28:48 +09:00
parent 271bb746d8
commit b55cbe7128
2 changed files with 18 additions and 16 deletions

View File

@@ -88,19 +88,22 @@ public class EmployeeData extends BaseData {
this.setPassword(password);
this.setIdDepartment(idDepartment);
}
//メソッド2つ追加
@Override
public String toCSV() {
return getIdEmployee() + "," + getNmEmployee() + "," + getKnEmployee() + "," + getMailAddress() + "," + getPassword() + "," + getIdDepartment();
}
@Override
public String getPrimaryKeyValue() {
return this.idEmployee;
}
@Override
public String toCSV() {
return getIdEmployee() + "," + getNmEmployee() + "," + getKnEmployee() + "," + getMailAddress() + ","
+ getPassword() + "," + getIdDepartment();
}
@Override
public String getPrimaryKeyValue() {
return this.idEmployee;
}
//メソッド追加
boolean isMatchID(String id) {
return idEmployee.equals(id);
}
}

View File

@@ -4,10 +4,9 @@ public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
//インスタンス宣言
//EmployeeData employee = new EmployeeData();
EmployeeData employee = new EmployeeData();
//配列5件分
EmployeeData[] employees = new EmployeeData[5];
//5段階目書き換え
employees[0] = new EmployeeData("10000", "山田龍也", "ヤマダタツヤ", "yamada@hoge.jp", "aaa", "10");
employees[1] = new EmployeeData("10001", "高橋準", "タカハシジュン", "jtaka@hoge.jp", "bbb", "10");
@@ -24,7 +23,7 @@ public class Main {
System.out.println(employees[i].toCSV());
System.out.println(employees[i].getPrimaryKeyValue());
//employees[i].showInfo();を上記に書き換え
}
}
}