7段階目(staticで社員データの件数を数えよう)
This commit is contained in:
@@ -1,17 +1,19 @@
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
EmployeeData employee = new EmployeeData("10000", "山田龍也", "ヤマダタツヤ",
|
||||
"yamada@hoge.jp", "aaa", "10");
|
||||
System.out.println(employee);
|
||||
System.out.println("会社名:" + EmployeeData.COMPANY_NAME);
|
||||
|
||||
// EmployeeData employee = new EmployeeData("10000", "山田龍也", "ヤマダタツヤ",
|
||||
// "yamada@hoge.jp", "aaa", "10");
|
||||
// System.out.println(employee);
|
||||
//
|
||||
// System.out.println();
|
||||
|
||||
EmployeeData[] employees = new EmployeeData[5];
|
||||
for (int i = 0; i < employees.length; i++) {
|
||||
employees[i] = new EmployeeData();
|
||||
}
|
||||
|
||||
System.out.println();
|
||||
|
||||
employees[0].setIdEmployee("10000");
|
||||
employees[0].setNmEmployee("山田龍也");
|
||||
employees[0].setKnEmployee("ヤマダタツヤ");
|
||||
@@ -51,6 +53,7 @@ public class Main {
|
||||
System.out.println(e);
|
||||
;
|
||||
}
|
||||
System.out.println("現在の社員のデータ件数:" + EmployeeData.getEmpCount() + "件");
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user