程序读入用户输入的一个值,要求创建一个异常,如果输入值大于10,使用throw语句显示地引发异常,异常输出的信息为“something‟s wrong!”,语句为()
第1题:
Something' s gone wrong with the window; it_______ not shut.
A、will
B、shall
C、would
D、should
第2题:
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!”);
第3题:
2号舱口处的起货机出故障了。()
第4题:
Which the statement is true?()
第5题:
Throw语句抛出的异常类型必须是()
第6题:
假设有自定义异常类ServiceException,那么抛出该异常的语句正确的是哪项?()
第7题:
class Birds { public static void main(String [] args) { try { throw new Exception(); } catch (Exception e) { try { throw new Exception(); } catch (Exception e2) { System.out.print("inner "); } System.out.print("middle "); } System.out.print("outer "); } } 结果为:()
第8题:
There is something wrong with the derrick at hatch No.2.
There is something wrong with the derrick at hatch No.1.
There is something wrong with the winch at hatch No.2.
There is something wrong with the winch at hatch No.1.
第9题:
Since the method foo() does not catch the exception generated by the method baz(), it must declare the RuntimeException in its throws clause.
A try block cannot be followed by both a catch and a finally block.
An empty catch block is not allowed.
A catch block cannot follow a finally block.
A finally block must always follow one or more catch blocks.
第10题:
System.Exception或从System.Exception派生的类型
System.Show类型
System类型
任意类型
第11题:
The Error class is a Runtime Exception.
No exceptions are subclasses of Error.
Any statement that may throw an Error must be enclosed in a try block.
any statement that may throw an Exception must be enclosed in a try block.
Any statement that may throw an Runtime Exception must be enclosed in a try block.
第12题:
to throw up ... to eat
throwing up ... eating
to throw up ... eat
throwing up ... eat
第13题:
下面程序输出的结果是什么? ( ) 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.无输出
第14题:
下面程序输出的结果是什么? ( ) 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.无输出
第15题:
下面哪些类型的实例对象可以通过throw语句抛出()。
第16题:
程序读入用户输入的一个值,要求创建一个自定义的异常,如果输入值大于10,使用throw语句显式地引发异常,异常输出信息为“something’s wrong!”, 语句为()。
第17题:
What is wrong with the following code?() class MyException extends Exception {} public class Qb4ab { public void foo() { try { bar(); } finally { baz(); } catch (MyException e) {} } public void bar() throws MyException { throw new MyException(); } public void baz() throws RuntimeException { throw new RuntimeException(); } }
第18题:
现有: class Birds { public static void main (String [] args) { try { throw new Exception () ; } catch (Exception e) { try { throw new Exception () ; } catch (Exception e2) { System.out.print ("inner "); } System. out.print ( "middle" ) ; } System.out.print ("outer") ; } } 结果是()
第19题:
if(i>10) throw Exception (“something‟s wrong!”);
if(i>10) throw Exception e (“something‟s wrong!”);
if(i>10) throw new Exception (“something‟s wrong!”);
if(i>10) throw new Exception e (“something‟s wrong!”);
第20题:
inner outer
middle outer
inner middle outer
.编译失败
第21题:
to throw up...to eat
throwing up...eating
to throw up...eat
throwing up...eat
第22题:
raise ServiceException
throw new ServiceException()
throw ServiceException
throws ServiceException
第23题:
if ( i > 10 ) throw Exception(“something’s wrong!”);
if ( i > 10 ) throw Exception e (“something’s wrong!”);
if ( i > 10 ) throw new Exception(“something’s wrong!”);
if ( i > 10 ) throw new Exception e (something’s wrong!);