6段階目(toStringをオーバーライドしよう)

This commit is contained in:
s-sakiyama
2026-09-15 13:55:35 +09:00
parent b58fcecaa2
commit f143cf7ec2
2 changed files with 11 additions and 8 deletions

View File

@@ -23,10 +23,11 @@ public class EmployeeData {
this.setIdDepartment(idDepartment);
}
void showInfo() {
System.out.println(this.idEmployee + "\t" + this.nmEmployee
@Override
public String toString() {
return this.idEmployee + "\t" + this.nmEmployee
+ "\t" + this.knEmployee + "\t" + this.mailAddress
+ "\t" + this.password + "\t" + this.idDepartment);
+ "\t" + this.password + "\t" + this.idDepartment;
}
public String getIdEmployee() {