单项选择题
现有:
class Number{
public static void main(String [] aras) {
try {
System.out.print (Integer.parselnt ("forty"));
} catch (RuntimeException r) {
System.out.print ("runtime");
} catch (NumberFormatException e) {
system..ut.print("number");
}
}
}
结果是什么?()
A.number
B.runtime
C.forty number
D.编译失败
点击查看答案&解析
相关考题
-
单项选择题
在方法的声明中,要求该方法必须抛出异常时使用哪个关键字?()
A. throw
B. catch
C. finally
D. throws -
单项选择题
假设有自定义异常类ServiceException,那么抛出该异常的语句正确的是哪项?()
A. raise ServiceException
B. throw new ServiceException()
C. throw ServiceException
D. throws ServiceException -
单项选择题
下列属于非受检异常的是哪项?()
A.SQLException
B.IOException
C.NullPointerException
D.OutOfMemoryError
