-
Yexiaomo
你看报错的信息 :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]);
}你输入参数,不就是相当于传参,你只传了一个,你却打印两个,所以一定会抛出下标越界异常
-
道临
因为你就传递了一个参数“1”,而这是要打印两个参数,所以第二条打印语句执行时会报空指针异常啊
-
慕的地8582982
BAHRPVFVKEMRSWTPLJTIZWCSOEHENEHDGIRTVYBZBKUFLHRNYPFJLHXDENDUFIXAPTZIYJMWSJFBRENKTJGWAPSJZVSBLBKHQTRKMJUXTXAPMVHQAFOLTDMIZMBDNDZWGOSIBQTCHKAEGJMNPXUXOEUJSVDTCLVRPTBMHUQAJFIACLWTNWFVZCZVEBPOLHZORVZOKSAIFOEBYUJMBAPGPFPSPXPFNWMJTPYVRISPGQMCFPENQZZOEBKVTVROQJMCSARUENKHCLILORURNCFXUCFCFWZIYBORUQNQMGDAWRBMPEBEUXHRMPLPFPFIKHDGIGPYVLOIYVJZBSPLUSNQCQNDMCTDMIYPVKVZIEADSVRDMPFCFBENCMQYDNDGPLUJFUXHRHEZCMWMTPZVSWYOKHDYAQMITKMVMCJROXUEHKNWMBHNNXHEMBMEDYWSPGKGVYIGILUFCZBXOXJPKDUOLBHZWVYIEAQUDFPSMNXHXHQAWMPJMVYBKBKGDZWRIYBDNXTWGCLOCFVMCRHKDMISPMCXGEAYAQTDMNYUXUEGDTWTILGQYQLPGWFOLNDBSBXMDZJMHYBRZWLBFOKGCMRAEILHMHDZXCRHLNLNIRCSFAXGPAQSVFIGAKGQGXHQGPGDGWMPFHDOWPFXZDHYAKNCCJZCLHXTPLVIKNKGIYOQUKDRNRBXZQSVSQSHXTJZIKOESPEOEASBDUDVDGDAOSPRIYHCMDNKMCSWRZCZUEUQTIYCUWTIYACFHEUGBLIYHRORARJFCRBYVXSQNRNWSIFPMPRSYOLISOYOKVEUDGCGDGBRUKPLHLCFUETXNQYWSCFPNCZWYTWTJZWAPYBWEJARBJHOSZADRBPMTUAYLWCTMALVJQTU