3日目 段階8 小澤
This commit is contained in:
@@ -36,19 +36,26 @@ public class Main {
|
|||||||
dept.setNmDepartment("営業企画部");
|
dept.setNmDepartment("営業企画部");
|
||||||
allData[10] = dept;
|
allData[10] = dept;
|
||||||
|
|
||||||
int emp=0;
|
|
||||||
int dep=0;
|
|
||||||
for (int i = 0; i < allData.length; i++) {
|
for (int i = 0; i < allData.length; i++) {
|
||||||
if (allData[i] instanceof EmployeeData) {
|
if (allData[i] instanceof EmployeeData) {
|
||||||
emp++;
|
EmployeeData emp = (EmployeeData) allData[i];
|
||||||
}
|
|
||||||
if(allData[i] instanceof DepartmentData) {
|
|
||||||
dep++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
System.out.println("社員データ:"+emp+"件");
|
|
||||||
System.out.println("部署データ:"+dep+"件");
|
|
||||||
|
|
||||||
|
System.out.println(emp.getMailAddress());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// int emp=0;
|
||||||
|
// int dep=0;
|
||||||
|
// for(int i=0;i<allData.length;i++) {
|
||||||
|
// if(allData[i] instanceof EmployeeData) {
|
||||||
|
// emp++;
|
||||||
|
// }
|
||||||
|
// if(allData[i] instanceof DepartmentData) {
|
||||||
|
// dep++;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// System.out.println("社員データ:"+emp+"件");
|
||||||
|
// System.out.println("部署データ:"+dep+"件");
|
||||||
|
|
||||||
// employees[0] = new EmployeeData("10000", "山田龍也", "ヤマダタツヤ", "yamada@hoge.jp", "aaa", "10");
|
// employees[0] = new EmployeeData("10000", "山田龍也", "ヤマダタツヤ", "yamada@hoge.jp", "aaa", "10");
|
||||||
// employees[1] = new EmployeeData("10001","高橋準","タカハシジュン","jtaka@hoge.jp","bbb","10");
|
// employees[1] = new EmployeeData("10001","高橋準","タカハシジュン","jtaka@hoge.jp","bbb","10");
|
||||||
@@ -61,7 +68,6 @@ public class Main {
|
|||||||
|
|
||||||
Scanner sc = new Scanner(System.in);
|
Scanner sc = new Scanner(System.in);
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < employees.length; i++) {
|
for (int i = 0; i < employees.length; i++) {
|
||||||
System.out.println("検索したい社員IDを入力してください(終了する場合は0)");
|
System.out.println("検索したい社員IDを入力してください(終了する場合は0)");
|
||||||
String id = sc.nextLine();
|
String id = sc.nextLine();
|
||||||
@@ -77,7 +83,6 @@ public class Main {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (result == false) {
|
if (result == false) {
|
||||||
System.out.println("該当する社員が見つかりませんでした");
|
System.out.println("該当する社員が見つかりませんでした");
|
||||||
}
|
}
|
||||||
@@ -85,10 +90,6 @@ public class Main {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// for(int i=0;i<5;i++) {
|
// for(int i=0;i<5;i++) {
|
||||||
// if(employee[i].getNmEmployee()==null) {
|
// if(employee[i].getNmEmployee()==null) {
|
||||||
// continue;
|
// continue;
|
||||||
@@ -110,6 +111,3 @@ public class Main {
|
|||||||
// System.out.println(employee.idDepartment);
|
// System.out.println(employee.idDepartment);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user