能在方法体内正确抛出异常的语句是:
A: new throw Exception(",,,,,,");
B: throw newException(",,,,,,");
C: throws newException(",,,,,,");
D: thrownewException;
A: new throw Exception(",,,,,,");
B: throw newException(",,,,,,");
C: throws newException(",,,,,,");
D: thrownewException;
举一反三
- 下列代码中给出正确的在方法体内抛出异常的是( )。 A: new throw Exception(" "); B: throw new Exception(" "); C: throws IOException(); D: throws IOException;
- throw和throws的说法不正确的是() A: throw是方法内抛出异常 B: throws是方法声明是抛出异常 C: throw可以抛出多个异常
- 以下关于throw的说法,正确的是 A: throw和throws的含义和用法一样 B: throw语句自行抛出异常,throw语句抛出的是异常类 C: throw语句自行抛出异常,throw语句抛出的不是异常类,而是一个异常对象 D: throw语句执行时,它后边的语句仍然会被执行
- 抛出异常、生成异常对象都通过下列( )语句实现。 A: throws B: throw C: Throwable D: Exception
- Java语言使用 ______语句来在方法体中抛出异常。 A: try B: catch C: throw D: throws