程序读入用户输入的一个值,要求创建一个自定义的异常,如果输入值大于10,使用throw语句显式地引发异常,异常输出信息为“something’s wrong!”, 语句为()。
第1题:
A.if(i>10)throwException(“something’swrong!”);
B.if(i>10)throwExceptione(“something’swrong!”);
C.if(i>10)thrownewException(“something’swrong!”);
D.if(i>10)thrownewExceptione("something’swrong!");
第2题:
一Shall we do something?
一Let's go to see a film.
A. Right
B. Wrong
第3题:
A.checking
B.check
C.to check
D.checked
第4题:
下面程序输出的结果是什么? ( ) public class Quiz2 { public static void main(String args[]) { try {throw new MyException(); }catch(Exception e) { System.out.println("It's caught!"); }finally{ System.out.println("It's finally caught!"); } } } class MyExeeption extends Exception{}
A.It's finally caught!
B.It's caught!
C.It's caught!/It'sfinally caught!
D.无输出
第5题:
下面程序输出的结果是什么? ( ) public class Quiz2 { public static void main(String args[]) { try {throw new MyException(); }catch(Exception e) { System.out.println("It's caught!"); }finally{ System.out.println("It's finally caught!"); } } } class MyException extends Exception{}
A.It's finally caught!
B.It's caught!
C.It's caught!/It's finally caught!
D.无输出
第6题:
A、It’s true.
B、It’s because of the quality.
C、There must be something wrong.
第7题:
Something' s gone wrong with the window; it_______ not shut.
A、will
B、shall
C、would
D、should
第8题:
A.if(i>10)throwException(“something?swrong!”);
B.if(i>10)throwExceptione(“something?swrong!”);
C.if(i>10)thrownewException(“something?swrong!”);
D.if(i>10)thrownewExceptione(“something?swrong!”);
第9题:
Java程序中读入用户输入的一个值,要求创建一个自定义的异常,如果输入值大于10,使用throw语句显式地引发异常,异常输出信息为“something’swrong!”,语句为()。
A.if(I>10)throw Exception(“something’swrong!”);
B.if(I>10)throw Exceptione(“something’swrong!”);
C.if(I>10)thrownew Exception(“something’swrong!”);
D.if(I>10)thrownew Exceptione(“something’swrong!”);
第10题:
2号舱口处的起货机出故障了。()