String[]elements={for”,tea”,too”};Stringfirst=(elements.length0)?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].
相关考题:
You are consuming a Windows Communication Foundation (WCF) service in an ASP. NET Web application.The service interface is defined as follows:[ServiceContract]public interface ICatalog{ [OperationContract] [WebGet(UriTemplate="/Catalog/Items/{id}", ResponseFormat=WebMessageFormat.Json)] string RetrieveItemDescription(int id); } The service is hosted at Catalogsvc.You need to call the service using jQuery to retrieve the description of an item as indicated by a variable named itemId. Which code segment should you use?()A. $get(String.format(/Catalogsvc/Catalog/Items/id{0}, itemId) null, function (data) { ... }, javascript);B. $get(String.format(/Catalogsvc/Catalog/Items/{0}, itemId), null, function (data) { ... }, json);C. $get(String.format(/Catalogsvc/Catalog/Items/{0}, itemld), null, function (data) { ... }, xml);D. $get(String.format(/Catalogsvc/Catalog/Items/id{0}, itemld), null, function (data) { ... }, json);
String[] elements={for,tea,too};String first=(elements.length0)?elements[0]null;What is the result?() A.Compilation fails.B.An exception is thrown at runtime.C.The variable first is set to null.D.The variable first is set to elements[0].
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.
publicclassTest{privatestaticint[]x;publicstaticvoidmain(String[]args){System.out.println(x[0]);}}Whatistheresult?() A.0B.nullC.Compilationfails.D.ANullPointerExceptionisthrownatruntime.E.AnArrayIndexOutOfBoundsExceptionisthrownatruntime.
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)
Given:String[]elements={for,tea,too};Stringfirst=(elements.length0)?elements[0]:null;Whatistheresult?() A.Compilationfails.B.Anexceptionisthrownatruntime.C.Thevariablefirstissettonull.D.Thevariablefirstissettoelements[0].