diff --git a/em-oop/src/EmployeeData.java b/em-oop/src/EmployeeData.java index 7f36691..bcb40d4 100644 --- a/em-oop/src/EmployeeData.java +++ b/em-oop/src/EmployeeData.java @@ -69,8 +69,9 @@ public class EmployeeData { this.idDepartment = idDepartment; } - public void showInfo() { - System.out.println(this.getIdEmployee() + "\t" + this.getNmEmployee() + "\t" + this.getKnEmployee() + "\t" + @Override + public String toString() { + return (this.getIdEmployee() + "\t" + this.getNmEmployee() + "\t" + this.getKnEmployee() + "\t" + this.getMailAddress() + "\t" + this.getPassword() + "\t" + this.getIdDepartment()); } diff --git a/em-oop/src/Main.java b/em-oop/src/Main.java index 74b771c..c5f3560 100644 --- a/em-oop/src/Main.java +++ b/em-oop/src/Main.java @@ -10,7 +10,8 @@ public class Main { employees[4] = new EmployeeData("10004", "三宅武", "ミタケタケシ", "miya@hoge.jp", "eee", "13"); for (int i = 0; i < employees.length; i++) { - employees[i].showInfo(); + + System.out.println(employees[i]); }