您的位置: 首页 > 文章 > 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 分类: 文章 • 2024-04-06 14:07:19 在eclipse中给mian的主函数赋值args要通过特定的运行方式,否则会报上图的错误 或者增加一个对args数组的判断,这样不会报复,但是也没有赋值 这里输入的1 2就是代表args[0] args[1]