2日目 段階7(余裕がある人向けも) 小澤
This commit is contained in:
@@ -6,14 +6,23 @@ 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() {
|
||||||
return getIdEmployee() + "\t" + getNmEmployee() + " " + getKnEmployee() + "\t" + getMailAddress()
|
return getIdEmployee() + "\t" + getNmEmployee() + " " + getKnEmployee() + "\t" + getMailAddress()
|
||||||
+ "\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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user