网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

1.publicclassExceptionTest{2.classTestExceptionextendsException{}3.publicvoidrunTest()throwsTestException{}4.publicvoidtest()/*PointX*/{5.runTest();6.}7.}AtPointXonline4,whichcodeisnecessarytomakethecodecompile?()

A.Nocodeisnecessary.

B.throwsException

C.catch(Exceptione)

D.throwsRuntimeException

E.catch(TestExceptione)


参考答案

更多 “ 1.publicclassExceptionTest{2.classTestExceptionextendsException{}3.publicvoidrunTest()throwsTestException{}4.publicvoidtest()/*PointX*/{5.runTest();6.}7.}AtPointXonline4,whichcodeisnecessarytomakethecodecompile?()A.Nocodeisnecessary.B.throwsExceptionC.catch(Exceptione)D.throwsRuntimeExceptionE.catch(TestExceptione) ” 相关考题
考题 publicclassExceptionTest{classTestExceptionextendsException{}publicvoidrunTest()throwsTestException{}publicvoidtest()/*PointX*/{runTest();}}AtpointXonline4,whichcodecanbeaddedtomakethecodecompile?() A.ThrowsException.B.Catch(Exceptione).C.ThrowsRuntimeException.D.Catch(TestExceptione).E.Nocodeisnecessary.

考题 importjava.io.IOException;publicclassExceptionTest(publicstaticvoidmain(String[]args)try(methodA();)catch(IOExceptione)(system.out.printIn(CaughtIOException”);)catch(Exceptione)(system.out.printIn(CaughtException”);))publicvoidmethodA(){thrownewIOException();}Whatistheresult?()A.Thecodewillnotcompile.B.Theoutputiscaughtexception.C.TheoutputiscaughtIOException.D.Theprogramexecutesnormallywithoutprintingamessage.

考题 importjava.io.IOException;publicclassExceptionTest(publicstaticvoidmain(Stringargs)try(methodA();)catch(IOExceptione)(system.out.printIn(CaughtIOException”);)catch(Exceptione)(system.out.printIn(CaughtException”);))publicvoidmethodA(){thrownewIOException();}Whatistheresult?()A.Thecodewillnotcompile.B.Theoutputiscaughtexception.C.TheoutputiscaughtIOException.D.Theprogramexecutesnormallywithoutprintingamessage.