2日目_6段階

This commit is contained in:
2026-09-24 09:59:27 +09:00
parent 9e19a2c2b9
commit 2094ebac56
3 changed files with 191 additions and 99 deletions

View File

@@ -1,5 +1,5 @@
public class EmployeeData {
public class EmployeeData {
// public static void main(String args[]) {
private String idEmployee;
@@ -9,6 +9,8 @@ public class EmployeeData {
private String password;
private String idDepartment;
// boolean isMatchID = isMatchId(idEmployee);//IdEmployeeが一致するか判断
//idEmployee「ID」を取得するgetter
public String getIdEmployee() {
return idEmployee;
@@ -63,6 +65,13 @@ public class EmployeeData {
this.idDepartment = idDepartment;
}
//メソッド名:isMatchId 引数:String id 戻り値:boolean ID一致ならtrue,違えばfalse
public boolean isMatchId(String id) {
return this.idEmployee.equals(id);
}
public EmployeeData(String idEmployee, String nmEmployee,
@@ -75,6 +84,15 @@ public class EmployeeData {
this.idDepartment = idDepartment;
}
// public boolean isMatchId(String id) {
//// if(idEmployee equals )
// {
//
// }
//
// }
// public String Employee(String idEmployee) {
// this.idEmployee= idEmployee;
// }
@@ -83,11 +101,17 @@ public class EmployeeData {
// TODO 自動生成されたコンストラクター・スタブ
}
public void showinfo() {
void showinfo() { //showinfo->toStringにメソッド名変更 + アクセス修飾子publicつける
// this.idEmployee = idEmployee;
System.out.println(this.idEmployee + "\t" + this.nmEmployee + "\t" + this.knEmployee + "\t" + this.mailAddress
+ "\t" + this.password + "\t" + this.idDepartment);
}
@Override
public String toString() {
return (this.idEmployee +"\t" + this.nmEmployee + "\t" + this.knEmployee + "\t" + this.mailAddress
+ "\t" + this.password + "\t" + this.idDepartment);
}
}