网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
程序读入用户输入的一个值,要求创建一个自定义的异常,如果输入值大于10,使用throw语句显式地引发异常,异常输出信息为“something’s wrong!”, 语句为()。
- A、if ( i > 10 ) throw Exception(“something’s wrong!”);
- B、if ( i > 10 ) throw Exception e (“something’s wrong!”);
- C、if ( i > 10 ) throw new Exception(“something’s wrong!”);
- D、if ( i > 10 ) throw new Exception e ("something’s wrong!");
参考答案
更多 “程序读入用户输入的一个值,要求创建一个自定义的异常,如果输入值大于10,使用throw语句显式地引发异常,异常输出信息为“something’s wrong!”, 语句为()。 A、if ( i 10 ) throw Exception(“something’s wrong!”);B、if ( i 10 ) throw Exception e (“something’s wrong!”);C、if ( i 10 ) throw new Exception(“something’s wrong!”);D、if ( i 10 ) throw new Exception e ("something’s wrong!");” 相关考题
考题
There is something wrong with my TV set, I must have it ().
A.checkingB.checkC.to checkD.checked
考题
程序读入用户输入的一个值,要求创建一个异常,如果输入值大于10,使用throw语句显示地引发异常,异常输出的信息为“something?swrong!”,语句为()
A.if(i10)throwException(“something?swrong!”);B.if(i10)throwExceptione(“something?swrong!”);C.if(i10)thrownewException(“something?swrong!”);D.if(i10)thrownewExceptione(“something?swrong!”);
考题
程序读入用户输入的一个值,要求创建一个自定义的异常,如果输入值大于10,使用throw语句显式地引发异常,异常输出信息为“something’swrong!”,语句为()。
A.if(i10)throwException(“something’swrong!”);B.if(i10)throwExceptione(“something’swrong!”);C.if(i10)thrownewException(“something’swrong!”);D.if(i10)thrownewExceptione(something’swrong!);
考题
-Your request for compensation made me surprised. What happened -()
A、It’s true.B、It’s because of the quality.C、There must be something wrong.
考题
下面程序输出的结果是什么? ( ) 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.无输出
考题
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!”);
考题
下面程序输出的结果是什么? ( ) 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.无输出
考题
2号舱口处的起货机出故障了。()A、There is something wrong with the derrick at hatch No.2.B、There is something wrong with the derrick at hatch No.1.C、There is something wrong with the winch at hatch No.2.D、There is something wrong with the winch at hatch No.1.
考题
Which the statement is true?()A、 The Error class is a Runtime Exception.B、 No exceptions are subclasses of Error.C、 Any statement that may throw an Error must be enclosed in a try block.D、 any statement that may throw an Exception must be enclosed in a try block.E、 Any statement that may throw an Runtime Exception must be enclosed in a try block.
考题
程序读入用户输入的一个值,要求创建一个异常,如果输入值大于10,使用throw语句显示地引发异常,异常输出的信息为“something‟s wrong!”,语句为() A、if(i10) throw Exception (“something‟s wrong!”);B、if(i10) throw Exception e (“something‟s wrong!”);C、if(i10) throw new Exception (“something‟s wrong!”);D、if(i10) throw new Exception e (“something‟s wrong!”);
考题
Throw语句抛出的异常类型必须是()A、 System.Exception或从System.Exception派生的类型B、 System.Show类型C、 System类型D、 任意类型
考题
假设有自定义异常类ServiceException,那么抛出该异常的语句正确的是哪项?() A、 raise ServiceExceptionB、 throw new ServiceException()C、 throw ServiceExceptionD、 throws ServiceException
考题
现有: 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") ; } } 结果是()A、 inner outerB、 middle outerC、 inner middle outerD、.编译失败
考题
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 "); } } 结果为:() A、innerB、inner outerC、middle outerD、inner middle outer
考题
单选题程序读入用户输入的一个值,要求创建一个异常,如果输入值大于10,使用throw语句显示地引发异常,异常输出的信息为“something‟s wrong!”,语句为()A
if(i10) throw Exception (“something‟s wrong!”);B
if(i10) throw Exception e (“something‟s wrong!”);C
if(i10) throw new Exception (“something‟s wrong!”);D
if(i10) throw new Exception e (“something‟s wrong!”);
考题
单选题A: I can’t seem to find a color TV of the new model. B: _______A
Why don’t you try the new store on King’s Road?B
There’s also something wrong with my TV set.C
Don’t you know the new model you want is not on the market yet?D
The new model is far more expensive than those old ones.
考题
单选题现有: 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") ; } } 结果是()A
inner outerB
middle outerC
inner middle outerD
.编译失败
考题
单选题There is something wrong with my TV set:I must have it _____.A
checkingB
cheekC
to checkD
checked
考题
单选题—I must have eaten something wrong. I feel like______ . —I told you not to eat at a restaurant. You’d better ______ at home.A
to throw up...to eatB
throwing up...eatingC
to throw up...eatD
throwing up...eat
考题
单选题Throw语句抛出的异常类型必须是()A
System.Exception或从System.Exception派生的类型B
System.Show类型C
System类型D
任意类型
考题
单选题假设有自定义异常类ServiceException,那么抛出该异常的语句正确的是哪项?()A
raise ServiceExceptionB
throw new ServiceException()C
throw ServiceExceptionD
throws ServiceException
考题
单选题Which the statement is true?()A
The Error class is a Runtime Exception.B
No exceptions are subclasses of Error.C
Any statement that may throw an Error must be enclosed in a try block.D
any statement that may throw an Exception must be enclosed in a try block.E
Any statement that may throw an Runtime Exception must be enclosed in a try block.
考题
单选题程序读入用户输入的一个值,要求创建一个自定义的异常,如果输入值大于10,使用throw语句显式地引发异常,异常输出信息为“something’s wrong!”, 语句为()。A
if ( i 10 ) throw Exception(“something’s wrong!”);B
if ( i 10 ) throw Exception e (“something’s wrong!”);C
if ( i 10 ) throw new Exception(“something’s wrong!”);D
if ( i 10 ) throw new Exception e (something’s wrong!);
考题
单选题—I must have eaten something wrong. I feel like ______. —I told you not to eat at a restaurant. You’d better ______ at home.A
to throw up ... to eatB
throwing up ... eatingC
to throw up ... eatD
throwing up ... eat
热门标签
最新试卷