在Eclipse中测试Main函数运行出现Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException:0
来源:互联网 发布:wpf专业编程指南 编辑:程序博客网 时间:2024/04/29 05:14
在对JAVA中Main函数以及参数String[] args比较迷惑的情况下,
找了百度问了问,得到一个测试的例子
package com.hello;
public class HelloWorld {
public static void main(String[] args) {
System.out.println(args[0]);
System.out.println(args[1]);
}
}
直接点击Eclipse中的运行的时候会出现
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at com.hello.HelloWorld.main(HelloWorld.java:5)
下面介绍在Eclipse中运行时输入参数的方法
运行按钮边上的小三角形-->运行配置,打开运行配置对话框
如图中输入两个参数,这里我输的是one two 中间用空格隔开,点击应用,然后再
点击运行,好了,结果如下:
- 在Eclipse中测试Main函数运行出现Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException:0
- Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
- Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
- Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
- Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
- 在dos中运行java程序,出现Exception in thread "main" java.lang.NoClassDefFoundError的原因
- Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException:5错误
- Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
- Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 6
- eclipse出现Exception in thread "main" java.lang.NoClassDefFoundError
- Dos下在运行JAVA出现Exception in thread "main" java.lang.NoClassDefFoundError:的解决
- Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 69760 at MyFirstApp.main(MyFir
- Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 5 at First.Demo1_13.main(Demo1
- java中出现java.lang.NoSuchMethodError: main,Exception in thread "main"
- java 运行时 Exception in thread "main" java.lang.NoClassDefFoundError
- Java运行错误:Exception in thread "main" java.lang.NoClassDefFoundError
- Java数组越界错误:Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 15
- Maven运行异常:Exception in thread "main" java.lang.UnsupportedClassVersionError
- Activity的启动模式(android:launchMode)
- 核心数据库CoreData之NSPersistentStoreCoordinator持久化存储
- Windows调试工具入门—1
- Android vcard使用示例,生成vcf文件
- 如果你懂,请不要只看到他的笑,你要看到他心底的泪
- 在Eclipse中测试Main函数运行出现Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException:0
- 海量数据处理的常用思路和方法
- Vector用法小结
- log4j.properties配置详解
- Html5学习------canvas绘制径向渐变图形
- Excel列批量插入公式
- 设计模式 - 组合模式
- Solr配置文件说明
- ClassPathXmlApplicationContext 和FileSystemXmlApplicationContext的区别是什么?