数组,异常处理,常用类。
static void procedure()
{
try
{
int c[]={1};
c[42]=99;
}
catch(ArrayIndexOutOfBoundsException e)
{
System.out.println(“数组超越界限异常:”+e);
}
}
public static void main(String args[])
{
try
{
procedure();
int a=args.length;
int b=42/a;
System.out.println(“b=”+b);
}
catch(ArithmeticException e)
{
System.out.println(“除0异常:”+e);
}
}
}
A.程序只输出第12行的异常信息
B.程序只输出第26行的异常信息
C.程序将不输出异常信息
D.程序将输出第12行和第26行的异常信息
16.下面程序抛出了一个“异常”并捕捉它。请在横线处填入适当内容完成程序。
class TrowsDemo
{
static void procedure() throws IllegalAccessExcepton
{
System.out.println(“inside procedure”);
throw___new
____IllegalAccessException(“demo”);
}
public static void main(String args[])
{
try