我收到错误信息,如果我执行下面的程序。它说o
无法解析为变量。以下Java程序的输出是什么?为什么我得到错误
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
try{
int o[] = new int[2];
o[3]=23;
o[1]=33;
}catch(Exception e){
System.out.println(e.getMessage());
e.printStackTrace();
}
System.out.println(o[1]); //THis line shows the error.
}
}
为什么我会收到该行System.out.println(o[1]);
?
看的,如通过印刷你的'catch'块。 –