回答編集履歴

1

nullを返さない

2020/07/21 15:03

投稿

momon-ga
momon-ga

スコア4820

test CHANGED
@@ -14,7 +14,9 @@
14
14
 
15
15
  if(persons == null || persons.length == 0) {
16
16
 
17
- return null;
17
+ // return null;
18
+
19
+ throw new IllegalArgumentException("person does not exist");
18
20
 
19
21
  }
20
22