11.classConverter{12.publicstaticvoidmain(String[]args){13.Integeri=args[0];14.intj=12;15.System.out.println(”Itis+(j==i)+thatj==i.”);16.}17.}WhatistheresultwhentheprogrammerattemptstocompilethecodeandrunitwiththecommandjavaConverter12?()A.Itistruethatj==i.B.Itisfalsethatj==i.C.Anexceptionisthrownatruntime.D.Compilationfailsbecauseofanerrorinline13.

11.classConverter{12.publicstaticvoidmain(String[]args){13.Integeri=args[0];14.intj=12;15.System.out.println(”Itis+(j==i)+thatj==i.”);16.}17.}WhatistheresultwhentheprogrammerattemptstocompilethecodeandrunitwiththecommandjavaConverter12?()

A.Itistruethatj==i.

B.Itisfalsethatj==i.

C.Anexceptionisthrownatruntime.

D.Compilationfailsbecauseofanerrorinline13.


相关考题:

11.public class Counter{12.public static void main(String[]args){13.int numArgs=/*insert code here*/;14.}15.}and the command line:java Counter one fred 42 Which code,inserted at line 13,captures the number of arguments passed into the program?()A.args.countB.args.lengthC.args.count()D.args.length()E.args.getLength()

11.public class Commander{12.public static void main(String[]args){13.String myProp=/*insert code here*/14.System.out.println(myProp);15.}16.}and the command line:java-Dprop.custom=gobstopper CommanderWhich two,placed on line13,will produce the output gobstopper?()A.System.load(prop.custom);B.System.getenv(prop.custom);C.System.property(prop.custom);D.System.getProperty(prop.custom);E.System.getProperties().getProperty(prop.custom);

publicstaticvoidappend(Listlist){list.add(”0042”);}12.publicstaticvoidmain(String[]args){13.ListintList=newArrayList();14.append(intList);15.System.out.println(intList.get(0));16.}Whatistheresult?() A.42B.0042C.Anexceptionisthrownatruntime.D.Compilationfailsbecauseofanerrorinline13.E.Compilationfailsbecauseofanerrorinline14.

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

1.classA{2.publicStringtoString(){3.return4”;4.}5.}6.classBextendsA{7.publicStringtoString(){8.returnsuper.toString()+3”;9.}10.}11.publicclassTest{12.publicstaticvoidmain(String[]args){13.System.out.printIn(newB());14.}15.}Whatistheresult?()A.Compilationsucceedsand4isprinted.B.Compilationsucceedsand43isprinted.C.Anerroronline9causescompilationtofail.D.Anerroronline14causescompilationtofail.E.Compilationsucceedsbutanexceptionisthrownatline9.

作为Java应用程序入口的main方法,其声明格式可以是( )。A、publicstaticvoidmain(String[]args)B、publicstaticintmain(String[]args)C、publicvoidmain(String[]args)D、publicintmain(String[]args)

Java程序中,main方法的格式正确的是()A.public static void main(String[] args)B.public static main(String[] args)C.public void main(String[] args)D.static void main(String[] args)

以下哪个main方法是正确的?A.public static void main(string[] args)B.public static void Main(String[] args)C.public static void main(String[] args)D.public static main(String[] args)E.public void main(String[] args)

main()方法的正确定义方式是()。A.public static void main (String [ ] args ) { new NameSurfer().start (args ) ; }B.public static main (String [ ] args ) { new NameSurfer().start (args ) ; }C.public void main (String [ ] args ) { new NameSurfer().start (args ) ; }D.public static void main (String [ ] args ) { NameSurfer().start (args ) ; }