单项选择题
下列程序的执行,说法错误的是
(C)
public
class
MultiCatch
{
public
static
void
main(String
args[])
{
try
{
int
a=args.length;
int
b=42/a;
int
c[]={1};
c[42]=99;
System.out.println(“b=”+b);
}
catch(ArithmeticException
e)
{
System.out.println(
“除
0
异常:
”
+e);
}
catch(ArrayIndexOutOfBoundsException
e)
{
System.out.println(
“数组超越边界异常:
”
+e);
}
}
}
A
、程序将输出第
15
行的异常信息
下列程序的执行,说法错误的是:
public class MultiCatch
{
public static void main(String args[])
{
try
{
int a=args.length;
int b=42/a;
int c[]={1};
c[42] = 99;
System.out.println(“b=”+b);
}
catch(ArithmeticException e)
{
System.out.println(“除0异常:”+e);}
catch(ArrayIndexOutOfBoundsException e)
{
System.out.println(“数组超越边界异常:”+e);
}
}
}
A.程序输出b=12
B.程序将输出第15和18行的异常信息
C.程序将输出第15行的异常信息
D.程序第10行出错