String[]elements={for”,tea”,too”};Stringfirst=(elements.length>0)?elements[0]null;Whatistheresult?()A.Compilationfails.B.Anexceptionisthrownatruntime.C.Thevariablefirstissettonull.D.Thevariablefirstissettoelements[0].

题目
String[]elements={for”,tea”,too”};Stringfirst=(elements.length>0)?elements[0]null;Whatistheresult?()

A.Compilationfails.

B.Anexceptionisthrownatruntime.

C.Thevariablefirstissettonull.

D.Thevariablefirstissettoelements[0].


相似考题
更多“String[]elements={for”,tea”,too”};Stringfirst=(elements.length>0)?elements[0]null;Whatistheresult?() ”相关问题
  • 第1题:

    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.test

    B.Exception

    C.Compilationfails.

    D.NullPointerException


    参考答案:C

  • 第2题:

    publicclassTest{privatestaticint[]x;publicstaticvoidmain(String[]args){System.out.println(x[0]);}}Whatistheresult?()

    A.0

    B.null

    C.Compilationfails.

    D.ANullPointerExceptionisthrownatruntime.

    E.AnArrayIndexOutOfBoundsExceptionisthrownatruntime.


    参考答案:D

  • 第3题:

    Given:String[]elements={"for","tea","too"};Stringfirst=(elements.length>0)?elements[0]:null;Whatistheresult?()

    A.Compilationfails.

    B.Anexceptionisthrownatruntime.

    C.Thevariablefirstissettonull.

    D.Thevariablefirstissettoelements[0].


    参考答案:D

  • 第4题:

    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.null

    B.zero

    C.some

    D.Compilationfails.

    E.Anexceptionisthrownatruntime.


    参考答案:D

  • 第5题:

    YouneedtodesignthestorageoftheapplicationtextsforUIelementstofulfilltherequirements.Whichtableandcolumndesignshouldyouuse?()

    A.Languages(LanguageID,Name)Elements(ElementID,Description)ElementLanguages(ElementID,LanguageID,Text)

    B.Languages(LanguageID,Name)Elements(ElementID,LanguageID,Description,Text)

    C.Languages(LanguageID,Name)ElementTexts(LanguageID,Text)ElementDescriptions(ElementID,Description)

    D.Languages(LanguageID,Name)Elements(ElementID,Description,Text)


    参考答案:A