package cn.dahuatech.netsdk;
public class Test {
public static void main(String[] args) {
System.out.println(args[0]);
}
}
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at cn.dahuatech.netsdk.Test.main(Test.java:7)
解决方案是:
改变测试方法
Run As-->Run Configurations-->(x)=Arguments-->Program arguments里面填写数据,然后再点run
本文详细介绍了在使用Java编程时遇到ArrayIndexOutOfBoundsException错误的解决方法,包括修改测试方法和运行配置步骤。通过在RunAs中设置Program arguments参数来传递数据,确保代码正确执行。
2982

被折叠的 条评论
为什么被折叠?



