2日目 段階7(余裕がある人向けも) 小澤

This commit is contained in:
2026-09-15 15:58:39 +09:00
parent e0c36acb0d
commit 0366ab5ac7
2 changed files with 19 additions and 0 deletions

View File

@@ -6,6 +6,10 @@ public class EmployeeData {
private String mailAddress; private String mailAddress;
private String password; private String password;
private String idDepartment; private String idDepartment;
private static int empCount = 0;
static final String COMPANY_NAME = "Rhizome";
@Override @Override
public String toString() { public String toString() {
@@ -13,7 +17,12 @@ public class EmployeeData {
+ "\t" + getPassword() + "\t" + getIdDepartment(); + "\t" + getPassword() + "\t" + getIdDepartment();
} }
static int getEmpCount() {
return empCount;
}
public EmployeeData() { public EmployeeData() {
empCount++;
} }
@@ -25,6 +34,7 @@ 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() {
@@ -75,4 +85,8 @@ public class EmployeeData {
this.idDepartment = idDepartment; this.idDepartment = idDepartment;
} }
} }

View File

@@ -46,11 +46,16 @@ public class Main {
employee[4].setIdDepartment("13"); employee[4].setIdDepartment("13");
// //
for(int i=0;i<5;i++) { for(int i=0;i<5;i++) {
System.out.println(employee[i]); System.out.println(employee[i]);
} }
System.out.println("現在の社員データ数"+EmployeeData.getEmpCount());
System.out.println(EmployeeData.COMPANY_NAME);
// System.out.println(); // System.out.println();
// System.out.println(employee.nmEmployee); // System.out.println(employee.nmEmployee);
// System.out.println(employee.knEmployee); // System.out.println(employee.knEmployee);