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

题目内容 (请给出正确答案)
Stringtest=Thisisatest”;12.String[]tokens=test.split(”\s”);13.System.out.println(tokens.length);Whatistheresult?()

A.0

B.1

C.4

D.Compilationfails.

E.Anexceptionisthrownatruntime.


参考答案

更多 “ Stringtest=Thisisatest”;12.String[]tokens=test.split(”\s”);13.System.out.println(tokens.length);Whatistheresult?() A.0B.1C.4D.Compilationfails.E.Anexceptionisthrownatruntime. ” 相关考题
考题 11.publicstaticvoidtest(Stringstr){12.if(str==null|str.lellgth()==0){13.System.out.println(”Stringisempty”);14.}else{15.System.out.println(”Stringisnotempty”);16.}17.}Andtheinvocation:31.test(llull);Whatistheresult?()A.Auexceptionisthrownatruntime.B.“Stringisempty”isprintedtooutput.C.Compilationfailsbecauseofauerrorinline12.D.“Stringisnotempty”isprintedtooutput.

考题 Stringtest=TestA.TestB.TestC.”;12.//insertcodehere13.String[]result=test.split(regex);Whichregularexpressioninsertedatline12willcorrectlysplittestintoTestA,”TestB,”andTestC”?() A.Stringregex=“”;B.Stringregex=““;C.Stringregex=“.*“.D.Stringregex=“\\s”E.Stringregex=“\\.\\s*”;F.Stringregex=“\\w[\.]+“;

考题 Stringtest=a1b2c3”;12.String[]tokens=test.split(”\\d”);13.for(Strings:tokens)System.out.print(s+);Whatistheresult?() A.abcB.123C.a1b2c3D.a1b2c3E.Compilationfails.F.Thecoderunswithnooutput.G.Anexceptionisthrownatruntime.

考题 intindex=1;Stringtest=newString;Stringfoo=test[index];Whatistheresult?() A. Foohasthevalue“”B.FoohasthevaluenullC.AnexceptionisthrownD.Thecodewillnotcompile

考题 publicclassfoo{publicstaticvoidmain(Stringargs){Strings;system.out.printIn(s=”+s);}}Whatistheresult?() A.Thecodecompilesand“s=”isprinted.B.Thecodecompilesand“s=null”isprinted.C.Thecodedoesnotcompilebecausestringsisnotinitialized.D.Thecodedoesnotcompilebecausestringscannotbereferenced.E.Thecodecompiles,butaNullPointerExceptionisthrownwhentoStringiscalled.

考题 Given:11.Stringtest=Thisisatest;12.String[]tokens=test.split(\s);13.System.out.println(tokens.length);Whatistheresult?() A.Anexceptionisthrownatruntime.B.1C.4D.Compilationfails.E.0

考题 Given:11.Stringtest=Thisisatest;12.String[]tokens=test.split(\s);13.System.out.println(tokens.length);Whatistheresult?() A.0B.1C.4D.Compilationfails.

考题 Given:11.Stringtest=a1b2c3;12.String[]tokens=test.split(\\d);13.for(Strings:tokens)System.out.print(s+);Whatistheresult?() A.abcB.123C.a1b2c3D.a1b2c3

考题 Given:11.Stringtest=TestA.TestB.TestC.;12.//insertcodehere13.String[]result=test.split(regex);Whichregularexpression,insertedatline12,correctlysplitstestintoTestA,TestB,andTestC?()A.Stringregex=;B.Stringregex=;C.Stringregex=.*;D.Stringregex=\\s;E.Stringregex=\\.\\s*;