publicclassTest{publicstaticvoidmain(String[]args){Stringfoo=args[1];Stringbar=args[2];Stringbaz=args[3];System.out.println(baz=+baz);}}Andthecommandlineinvocation:javaTestredgreenblueWhatistheresult?()A.baz=B.baz=nullC.baz=blueD.Compilationfails.E.Anexceptionisthrownatruntime.
publicclassTest{publicstaticvoidmain(String[]args){Stringfoo=args[1];Stringbar=args[2];Stringbaz=args[3];System.out.println(baz=+baz);}}Andthecommandlineinvocation:javaTestredgreenblueWhatistheresult?()
A.baz=
B.baz=null
C.baz=blue
D.Compilationfails.
E.Anexceptionisthrownatruntime.
相关考题:
publicclassTest{publicstaticvoidmain(String[]args){stringfoo=blue”;stringbar=foo;foo=green”;System.out.printIn(bar);}}Whatistheresult?() A.Anexceptionisthrown.B.Thecodewillnotcompile.C.Theprogramprints“null”D.Theprogramprints“blue”E.Theprogramprints“green”
publicclassTest{publicstaticvoidmain(String[]args){Stringfoo=args[1];Stringbar=args[2];Stringbaz=args[3];System.out.printIn(baz=”+baz);}}Andtheoutput:Baz=2Whichcommandlineinvocationwillproducetheoutput?()A.JavaTest2222B.JavaTest1234C.JavaTest4242D.JavaTest4321
publicclasstest(publicstaticvoidmain(string[]args){stringfoo=args[1];stringfoo=args[2];stringfoo=args[3];})Andcommandlineinvocation:JavaTestredgreenblueWhatistheresult?() A.Bazhasthevalueof“”B.BazhasthevalueofnullC.Bazhasthevalueof“red”D.Bazhasthevalueof“blue”E.Baxhasthevalueof“green”F.Theprogramthrowsanexception.
publicclassTest{publicstaticvoidmain(String[]args){Stringstr=NULL;System.out.println(str);}}Whatistheresult?() A.NULLB.Compilationfails.C.Thecoderunswithnooutput.D.Anexceptionisthrownatruntime.
publicclassTest{publicstaticvoidmain(String[]args){System.out.println(args.length4args[4].equals(-d”));}}Iftheprogramisinvokedusingthecommandline:javaTestOneTwoThree–dWhatistheresult?() A.trueB.falseC.Compilationfails.D.Anexceptionisthrownatruntime.
publicclassTest{publicstaticvoidmain(Stringargs){Stringfoo=args[1];Stringbar=args;Stringbaz=args;System.out.printIn(baz=”+baz);}}Andtheoutput:Baz=2Whichcommandlineinvocationwillproducetheoutput?() A.JavaTest2222B.JavaTest1234C.JavaTest4242D.JavaTest4321
publicclasstest(publicstaticvoidmain(stringargs){stringfoo=args[1];stringfoo=args;stringfoo=args;})Andcommandlineinvocation:JavaTestredgreenblueWhatistheresult?() A.Bazhasthevalueof“”B.BazhasthevalueofnullC.Bazhasthevalueof“red”D.Bazhasthevalueof“blue”E.Baxhasthevalueof“green”F.Theprogramthrowsanexception.
以下哪个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 ) ; }