3日目段階5完了しました
This commit is contained in:
@@ -3,7 +3,7 @@ import java.util.Scanner;
|
||||
public class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
EmployeeData[] employee = new EmployeeData[5];
|
||||
BaseDate[] employee = new BaseDate[5];
|
||||
|
||||
employee[0] = new EmployeeData("10000", "山田龍也", "ヤマダタツヤ", "yamada@hoge.jp", "aaa", "10");
|
||||
employee[1] = new EmployeeData("10001", "高橋準", "タカハシジュン", "jtaka@hoge.jp", "bbb", "11");
|
||||
@@ -25,12 +25,10 @@ public class Main {
|
||||
Scanner sc = new Scanner(System.in);
|
||||
str = sc.nextLine();
|
||||
for (int i = 0; i <= 4; i++) {
|
||||
boolean bo = employee[i].isMatchId(str);
|
||||
if (bo == true) {
|
||||
if (employee[i].getPrimaryKeyValue().equals(str)){
|
||||
System.out.println(employee[i]);
|
||||
break;
|
||||
}
|
||||
if (bo == false && i == 4 && !str.equals("0")) {
|
||||
} else if(!employee[i].getPrimaryKeyValue().equals(str) && i==4 && !str.equals("0")) {
|
||||
System.out.println("該当する社員が見つかりませんでした");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user