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

相关文章:

  • 2022-12-23
  • 2021-05-02
  • 2021-05-27
  • 2021-09-07
  • 2022-12-23
  • 2022-03-10
  • 2022-12-23
  • 2021-06-20
猜你喜欢
  • 2022-12-23
  • 2021-12-27
  • 2021-08-05
  • 2021-08-31
  • 2021-12-15
  • 2021-12-14
  • 2022-12-23
相关资源
相似解决方案