Stringa=null;a.concat(abc”);a.concat(def”);System.out.println(a);Whatistheresult?() A.abcB.nullC.abcdefD.Compilationfails.E.Thecoderunswithnooutput.F.Anexceptionisthrownatruntime.

Stringa=null;a.concat(abc”);a.concat(def”);System.out.println(a);Whatistheresult?()

A.abc

B.null

C.abcdef

D.Compilationfails.

E.Thecoderunswithnooutput.

F.Anexceptionisthrownatruntime.


相关考题:

已知△ABC∽△DEF,且AB:DE=1:2,则△ABC的面积与△DEF的面积之比为(A)1:2 (B)1:4 (C)2:1 (D)4:1

public static void main(String[]args){String str=null;if(str==null){System.out.println(null);}else(str.length()==0){System.out.println(zero);}else{System.out.println(some);}}What is the result?()A.nullB.zeroC.someD.Compilationfails.E.Anexceptionisthrownatruntime.

publicstaticvoidmain(String[]args){try{args=null;args[0]=test”;System.out.println(args[0]);}catch(Exceptionex){System.out.println(”Exception”);}catch(NullPointerExceptionnpe){System.out.println(”NullPointerException”);}}Whatistheresult?()A.testB.ExceptionC.Compilationfails.D.NullPointerException

publicstaticvoidmain(String[]args){Stringstr=null?;if(str==null){System.out.println(”null”);}else(str.length()==0){System.out.println(”zero”);}else{System.out.println(”some”);}}Whatistheresult?() A.nullB.zeroC.someD.Compilationfails.E.Anexceptionisthrownatruntime.

classTestA{publicvoidstart(){System.out.println(”TestA”);}}publicclassTestBextendsTestA{publicvoidstart(){System.out.println(”TestB”);}publicstaticvoidmain(String[]args){((TestA)newTestB()).start();}}Whatistheresult?()A.TestAB.TestBC.Compilationfails.D.Anexceptionisthrownatruntime.

classParent{Stringone,two; classParent{Stringone,two;publicParent(Stringa,Stringb){one=a;two=b;}publicvoidprint(){System.out.println(one);}}publicclassChildextendsParent{publicChild(Stringa,Stringb){super(a,b);}publicvoidprint(){System.out.println(one+to+two);}publicstaticvoidmain(Stringarg[]){Parentp=newParent(south,north);Parentt=newChild(east,west);p.print();t.print();}}Whichofthefollowingiscorrect?()

Giventhefollowingcode:publicclassPerson{intarr[]=newint[10];publicstaticvoidmain(Stringa[]){System.out.println(arr[1]);}}Whichstatementiscorrect?() A.Whencompilationsomeerrorwilloccur.B.Itiscorrectwhencompilationbutwillcauseerrorwhenrunning.C.Theoutputiszero.D.Theoutputisnull.

Stringa=ABCD”;Stringb=a.toLowerCase();b.replace(‘a’,‘d’);b.replace(‘b’,‘c’);System.out.println(b);Whatistheresult?() A.abcdB.ABCDC.dccdD.dcbaE.Compilationfails.F.Anexceptionisthrownatruntime.

publicclassTest{publicstaticvoidmain(String[]args){Stringstr=NULL;System.out.println(str);}}Whatistheresult?() A.NULLB.Compilationfails.C.Thecoderunswithnooutput.D.Anexceptionisthrownatruntime.

try{if((newObject))(.equals((newObject()))){System.out.println(equal”);}else{System.out.println(notequal”);}}catch(Exceptione){System.out.println(exception”);}Whatistheresult?() A.equalB.notequalC.exceptionD.Compilationfails.

try{intx=0;inty=5/x;}catch(Exceptione){System.out.println(Exception”);}catch(ArithmeticExceptionae){System.out.println(ArithmeticException”);}System.out.println(finished”);Whatistheresult?() A.finishedB.ExceptionC.Compilationfails.D.ArithmeticException

booleanbool=true;if(bool=false){System.out.println(“a”);}elseif(bool){System.out.println(“c”);}elseif(!bool){System.out.println(“c”);}else{System.out.println(“d”);}Whatistheresult?() A.aB.bC.cD.dE.Compilationfails.

publicclassTest{publicstaticvoidaMethod()throwsException{try{thrownewException();}finally{System.out.println(finally”);}}publicstaticvoidmain(Stringargs[]){try{aMethod();}catch(Exceptione){System.out.println(exception”);}System.out.println(finished”);}}Whatistheresult?()A.finallyB.exceptionfinishedC.finallyexceptionfinishedD.Compilationfails.

定义一个表示10个值为null的字符串数组,下面选项正确的是( )。A.String[]a;B.Stringa[];C.chara[10][];D.Stringa[]=new String[10];

A.abc过程吸热,def过程放热B.abc过程放热,def过程吸热C.abc过程和def程都吸热D.ahc过程和def过程都放热

定义一个表示20个值为null的字符串数组,下面选项正确的是()。A、String[]aB、Stringa[]C、chara[20][]D、Stringa[]=newString[20]

public static void main(String[] args) {  String str = “null‟;  if (str == null) {  System.out.println(”null”);  } else (str.length() == 0) {  System.out.println(”zero”);  } else {  System.out.println(”some”);  }  }  What is the result?()A、 nullB、 zeroC、 someD、 Compilation fails.E、 An exception is thrown at runtime.

在Word的编辑状态下,打开文档ABC,修改后另存为DEF,则()A、ABC是当前文档B、DEF是当前文档C、ABC和DEF均是当前文档D、ABC和DEF均不是当前文档

vara=[“a”,“b”,“c”];varb=[“d”,“e”,“f”];有a,b两个数组,下面哪个选项可以把a,b合成一个新的数组()。A、全不正确B、varc=a.push()+b.push()C、varc=a.concat(b)D、varc=a.join(b)

vara="A";varx=a.concat("B");x的值是什么()。A、["A","B"]B、ABC、AD、B

String a = null;  a.concat(“abc”);  a.concat(“def”);  System.out.println(a);   What is the result?()  A、 abcB、 nullC、 abcdefD、 Compilation fails.E、 The code runs with no output.F、 An exception is thrown at runtime.

public static void main(String[]args){ String str="null"; if(str==null){ System.out.println("null"); }else(str.length()==0){ System.out.println("zero"); }else{ System.out.println("some"); } } What is the result?()A、nullB、zeroC、someD、Compilationfails.E、Anexceptionisthrownatruntime.

319机型救生船存放位置().A、4ABC/DEF、11ABC/DEF、22ABC/DEFB、4ABC、11ABC/DEF、22ABC/DEFC、4ABC/DEF、11DEF、22ABC/DEFD、4ABC/DEF、11ABC/DEF、22DEF

填空题已知△ABC~△DEF,△ABC与△DEF的相似比为4:1,则△ABC与△DEF对应边上的高之比为____.

单选题String a = null;  a.concat(“abc”);  a.concat(“def”);  System.out.println(a);   What is the result?()A abcB nullC abcdefD Compilation fails.E The code runs with no output.F An exception is thrown at runtime.

单选题vara="A";varx=a.concat("B");x的值是什么()。A[A,B]BABCADB

单选题public static void main(String[] args) {  String str = “null‟;  if (str == null) {  System.out.println(”null”);  } else (str.length() == 0) {  System.out.println(”zero”);  } else {  System.out.println(”some”);  }  }  What is the result?()A nullB zeroC someD Compilation fails.E An exception is thrown at runtime.