publicclassExceptionTest{classTestExceptionextendsException{}publicvoidrunTest()throwsTestException{}publicvoidtest()/*PointX*/{runTest();}}AtpointXonline4,whichcodecanbeaddedtomakethecodecompile?() A.ThrowsException.B.Catch(Exceptione).C.ThrowsRuntimeException.D.Catch(TestExceptione).E.Nocodeisnecessary.

publicclassExceptionTest{classTestExceptionextendsException{}publicvoidrunTest()throwsTestException{}publicvoidtest()/*PointX*/{runTest();}}AtpointXonline4,whichcodecanbeaddedtomakethecodecompile?()

A.ThrowsException.

B.Catch(Exceptione).

C.ThrowsRuntimeException.

D.Catch(TestExceptione).

E.Nocodeisnecessary.


相关考题:

给出下列java源代码://PointxPublicclassInteresting{}在源代码//pointx处添加()能符合java语法 A.importjava.awt.*B.packagelocal.utilC.classMoreInteresting{}D.protectedclassMoreInteresting{}

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.

publicclassTest {}Whatistheprototypeofthedefaultconstructor?() A.Test()B.Test(void)C.publicTest()D.publicTest(void)E.publicvoidTest()

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)

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.

阅读下列程序段,不合法的行是______。 class Computer{} class Monitor extends Computer{} class HardDrive extends Computer { public void test() { Monitor a = new Monitor(); Computer b = new Monitor(); HardDrive c = (HardDrive) a; Monitor d = b; } } ①Monitor a = new Monitor(); ②Computer b = new Monitor(); ③HardDrive c = (HardDfive)a; ④Monitor d = b;A.①②③B.③④C.①③④D.②④

可以在下面代码段point x处写入的是? //point x public class Interesting{ //do something }A.String str;B.static int PI=3.14;C.public class MyClass{//do other thing…}D.import java.awt.*;

给定如下代码,下面哪个可以作为该类的构造函数()。 public class Test { ? }A.public void Test() {?}B.public Test() {?}C.public static Test() {?}D.public static void Test() {?}

给定如下代码,下面哪个可以作为该类的构造函数()。public class Test { ?A.public void Test() {?}B.public Test() {?}C.public static Test() {?}D.public static void Test() {?}