8段階目(セッターに簡単なチェックを入れてみよう)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user