7段階目終わりました
This commit is contained in:
@@ -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());
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ public class Main {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
System.out.println("現在の社員データ件数:" + EmployeeData.getEmpCount() + "件");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user