8段階目(セッターに簡単なチェックを入れてみよう)

This commit is contained in:
s-sakiyama
2026-09-15 14:24:20 +09:00
parent 3b6b23c883
commit 968c5094a4
2 changed files with 14 additions and 1 deletions

View File

@@ -48,6 +48,10 @@ public class EmployeeData {
}
public void setNmEmployee(String nmEmployee) {
if (nmEmployee == null || nmEmployee.strip().length() == 0) {
System.out.println("社員名が空のため設定できませんでした");
return;
}
this.nmEmployee = nmEmployee;
}
@@ -86,5 +90,4 @@ public class EmployeeData {
public static int getEmpCount() {
return empCount;
}
}