- IllegalArgumentException:表明向方法返回了一个不合法或者不正确的参数
- 往往在一个方法的最后写上抛出的异常
比如
public int[] test() {
.....
.....
if(xxxx){
return new int[]{1,i};
}
.....
throw new IllegalArgumentException("xxxxxx");
}
public int[] test() {
.....
.....
if(xxxx){
return new int[]{1,i};
}
.....
throw new IllegalArgumentException("xxxxxx");
}