package test1;
public class Switch {
public static void main(String[] args)
{
int Day = Integer.parseInt(args[0]);
switch (Day) {
case 1 :
System.out.println("周一");
break ;
case 2 :
System.out.println("周二");
break ;
default :
System.out.println("無效");
break ;
}
}
}
錯誤 Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
at test1/test1.Switch.main(Switch.java:7)
好像是索引超出什么限制了
uj5u.com熱心網友回復:
這不是很明顯嗎,你傳值可能傳了多個值,你就一個呀轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/149562.html
標籤:基礎類
上一篇:sql server 2012 安裝后 注冊表中不全
下一篇:找不到類別庫
