public class test
{public static void main(string args[])
{try
{int x[ ]={4,5,6};
I nt k=integer.parseint(args[0]);
S ystem.out.printin(x[k]);
S ystem.out.printin( ” try结束! ” );
}
C atch(Arrayindexoutofboundsexceptione)
{ system.out.printIn(“执行catch”);}
F inally{system.out.printin(“执行finally ” );}
S ystem.out.printIn( “ 程序结束! ” );
}
}
若在命令行编译程序后,键入下面的内容运行该程序:
J ava Test 2
则程序输出的结果:______________
______________
______________
______________
