现有 1. class Calc { 2. public static void main(String [] args) { 3. try { 4. int x = Integer.parselnt ("42a") ; 5. //insert code here 6. System.out.print ("oops"); 7. } 8. } 9. } 下面哪两行分别插入到第五行,会导致输 "oops" ? ()
A} catch (IllegalArgumentException e) {
B} catch (IllegalStateException c) {
C} catch (NumbelFormatException n) {
D} catch (ClassCastException c) {
相关问题推荐
-
组件的getBounds()方法返回值的类型是哪项?()
A、 Dimension
B、 Rectangle
C、 Point
D、 int[]
-
以下关于File 类的叙述,哪两项正确?()
AFile 类位于java.io 包中
B创建一个File 类的实例将导致打开指定文件进行读写
CFile 实例封装了指定文件的信息
DFile 实例不能用于封装目录
-
假设有字符串“123”,能把该字符串变成整数的方法是哪几项?()
A、Integer.parseInt(”123”)
B、Float.parseFloat(“123”)
C、Integer.valueOf(“123”).initValue()
D、以上都不是
-
在方法的声明中,要求该方法必须抛出异常时使用哪个关键字?()
A、 throw
B、 catch
C、 finally
D、 throws
-
public classYippee{ public static void main(String[]args){ for(intx=1;xSystem.out.print(args[x]+""); } } } and two separate command line invocations:j avaYippee javaYippee1234 What is the result?()
A、No output is produced. 123
B、No output is produced. 234
C、No output is produced. 1234
D、An exception is thrown at runtime. 123
E、An exception is thrown at runtime. 234
F、An exception is thrown at runtime. 1234