3 回答
已采纳

Yexiaomo
TA贡献152条经验 获得超157个赞
你看报错的信息 :Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
一看就是数组下标越界了, array index out of bourds exception
--------------------
其实你就把这个看成普通的函数如:
public static void main(String[] args) { System.out.println(args[0]); System.out.println(args[1]); }
你输入参数,不就是相当于传参,
你只传了一个,你却打印两个,所以一定会抛出下标越界异常

添加回答
举报
0/150
提交
取消