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,14 +6,23 @@ public class EmployeeData {
private String mailAddress;
private String password;
private String idDepartment;
private static int empCount = 0;
static final String COMPANY_NAME = "Rhizome";
@Override
public String toString() {
return getIdEmployee() + "\t" + getNmEmployee() + " " + getKnEmployee() + "\t" + getMailAddress()
+ "\t" + getPassword() + "\t" + getIdDepartment();
}
static int getEmpCount() {
return empCount;
}
public EmployeeData() {
empCount++;
}
@@ -25,6 +34,7 @@ public class EmployeeData {
this.setMailAddress(mailAddress);
this.setPassword(password);
this.setIdDepartment(idDepartment);
empCount++;
}
public String getIdEmployee() {
@@ -75,4 +85,8 @@ public class EmployeeData {
this.idDepartment = idDepartment;
}
}

View File

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