Given:Which statement is true?() A. Compilation succeeds.B. Class A does not compile.C. The method declared on line 9 cannot be modified to throw TestException.D. TestA compiles if line 10 is enclosed in a try/catch block that catches TestException.

Given:Which statement is true?()

A. Compilation succeeds.

B. Class A does not compile.

C. The method declared on line 9 cannot be modified to throw TestException.

D. TestA compiles if line 10 is enclosed in a try/catch block that catches TestException.


相关考题:

When all the people had assembled, the king, surrounded by his court, (21) a signal. Then a door beneath him opened, and the accused man stepped (22) into the arena. Directly opposite him were two doors, exactly (23) and side by side. It was the duty and the privilege of the (24) on trial to walk directly to these (25) and open one of them. He (26) open either door he pleased; he was subject to no (27) or influence. If he opened the one, there came out of it a hungry tiger, the (28) and most cruel that could be found, which (29) sprang upon him and tore him to pieces as a punishment for his guilt. (30) , if the accused person opened the other door, out of it came a (31) lady, and to this lady he was immediately married, as a reward of his innocence. This was the (32) method of administering justice. Its perfect fairness is obvious. The criminal could (33) know out of which door would come the lady; he opened either he pleased, without having the slightest (34) whether, in the next instant, he was to be devoured or married. So the accused person was instantly (35) if guilty, and, if innocent, he was rewarded on the spot.21.A. giveB. givesC. gaveD. given

publicclassTest{publicstaticvoidmain(String[]args){booleanassert=true;if(assert){System.out.println(”assertistrue”);}}}Given:javac-source1.3Test.javaWhatistheresult?() A.Compilationfails.B.Compilationsucceedswitherrors.C.Compilationsucceedswithwarnings.D.Compilationsucceedswithoutwarningsorerrors.

Thefilefile.txt”existsonthefilesystemandcontsinsASCIItext.Given:try{Filef=newFile(file.txt”);OutputStreamout=newFileOutputStream(f,true);}catch(IOException){}Whatistheresult?() A.Thecodedoesnotcompile.B.Thecoderunsandnochangeismadetothefile.C.Thecoderunsandsetsthelengthofthefileto0.D.Anexceptionisthrownbecausethefileisnotclosed.E.Thecoderunsanddeletesthefilefromthefilesystem.

Given:12.Stringcsv=Sue,5,true,3;13.Scannerscanner=newScanner(csv);14.scanner.useDelimiter(,);15.intage=scanner.nextInt();Whatistheresult?() A.Compilationfails.B.Afterline15,thevalueofageis5.C.Afterline15,thevalueofageis3.D.Anexceptionisthrownatruntime.

Refertotheexhibit.GiventheDHCPpoolconfigurationshownonRouterA,theCiscoIPphonewillnotbootupintheTeleworkerlocation.WhatismissingfromtheTeleworkerDHCPpoolconfiguration?() A.TheDHCPpoolneedstohaveanimportallstatement.B.TheDHCPpoolismissinganoption150ip10.59.138.1statement.C.TheDHCPpoolismissinganoption139ip10.59.138.1statementD.TheDHCPpoolismissingadns-server10.59.138.1statement.

下列选项中,关于Statement描述错误的是()A.Statement是用来执行SQL语句的B.Statement是PreparedStatement的子接口C.获取Statement实现需要使用Connection的createStatement()方法D.PreparedStatement能使用参数占位符,而Statement不行

JDBC中Statement表示语句。

要按先ResultSet结果集,后Statement,最后Connection的顺序关闭资源,因为Statement和ResultSet是需要连接是才可以使用的,所以在使用结束之后有可能其他的Statement还需要连接,所以不能先关闭Connection。

下列选项中,关于Statement描述错误的是()A.Statement是用来执行SQL语句的B.Statement是PreparedStatement的子接口C.获取Statement实现需要使用Connection的createStatement()方法D.PreparedStatement能使用参数占位符,而Statement不行

3.下列选项中,关于Statement描述错误的是() A: Statement是用来执行SQL语句的 B: Statement是PreparedStatement的子接口 C: 获取Statement实现需要使用Connection的createStatement()方法 D: PreparedStatement能使用参数占位符,而Statement不行A.A B C DB.A B C DC.A B C DD.A B C D