java:Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at com.edu.Sum.main

java:Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at com.edu.Sum.main

在eclipse中给mian的主函数赋值args要通过特定的运行方式,否则会报上图的错误

或者增加一个对args数组的判断,这样不会报复,但是也没有赋值
java:Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at com.edu.Sum.main

这里输入的1 2就是代表args[0] args[1]

java:Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at com.edu.Sum.main

java:Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at com.edu.Sum.main