7段階目終わりました

This commit is contained in:
2026-09-15 16:43:23 +09:00
parent 782d0db2a9
commit 6468a372ce
2 changed files with 18 additions and 1 deletions

View File

@@ -7,8 +7,20 @@ public class EmployeeData {
private String password; private String password;
private String idDepartment; private String idDepartment;
public EmployeeData() { private static int empCount = 0;
static int getempCount() {
return empCount;
}
public EmployeeData() {
empCount++;
}
static int getEmpCount() {
return empCount;
} }
public EmployeeData(String idEmployee, String nmEmployee, String knEmployee, String mailAddress, String password, public EmployeeData(String idEmployee, String nmEmployee, String knEmployee, String mailAddress, String password,
@@ -19,6 +31,8 @@ public class EmployeeData {
this.setMailAddress(mailAddress); this.setMailAddress(mailAddress);
this.setPassword(password); this.setPassword(password);
this.setIdDepartment(idDepartment); this.setIdDepartment(idDepartment);
empCount++;
} }
public String getIdEmployee() { public String getIdEmployee() {
@@ -71,6 +85,7 @@ public class EmployeeData {
@Override @Override
public String toString() { public String toString() {
return (this.getIdEmployee() + "\t" + this.getNmEmployee() + "\t" + this.getKnEmployee() + "\t" return (this.getIdEmployee() + "\t" + this.getNmEmployee() + "\t" + this.getKnEmployee() + "\t"
+ this.getMailAddress() + "\t" + this.getPassword() + "\t" + this.getIdDepartment()); + this.getMailAddress() + "\t" + this.getPassword() + "\t" + this.getIdDepartment());

View File

@@ -15,6 +15,8 @@ public class Main {
} }
System.out.println("現在の社員データ件数:" + EmployeeData.getEmpCount() + "件");
} }
} }