publicclassAlpha{privatestaticCharacter()ids;publicstaticvoidmain(String[]args){ids=newCharacter[args.length];for(inti=0;iids[i]=newCharacter(args[i]);System.out.print(ids[i]);}}}Whatiscorrect?() A.Compilationfails.B.Thecoderunswithnooutput.C.Anexceptionisthrownatruntime.D.Thecoderuns,outputingaconcatenatedlistoftheargumentspassedtotheprogram.

publicclassAlpha{privatestaticCharacter()ids;publicstaticvoidmain(String[]args){ids=newCharacter[args.length];for(inti=0;iids[i]=newCharacter(args[i]);System.out.print(ids[i]);}}}Whatiscorrect?()

A.Compilationfails.

B.Thecoderunswithnooutput.

C.Anexceptionisthrownatruntime.

D.Thecoderuns,outputingaconcatenatedlistoftheargumentspassedtotheprogram.


相关考题:

classTestApp{publicstaticvoidmain(String[]args){for(inti=0;i10;i++){if(i==3)break;System.out.print(i);}}}程序运行后的输出是哪项?() A.0123B.012C.0123456789D.012456789

程序:classTestApp{publicstaticvoidmain(String[]args){for(inti=0;i10;i++){if(i==3)break;System.out.print(i);}}}程序运行后的输出是哪项?() A.0123B.012C.0123456789D.012456789

现有:classTestApp{publicstaticvoidmain(String[]args){for(inti=0;iif(i==3)break;System.out.print(i);}}}程序运行后的输出是哪项?() A.0123B.012456789C.0123456789D.012

publicclassAlpha{publicstaticvoidmain(string[]args){if(args.length==2){if(args.[0].equalsIgnoreCase(-b”))System.out.println(newBoolean(args[1]));}}}Andthecodeisinvokedbyusingthecommand:javaAlpha–bTRUEWhatistheresult?()A.trueB.nullC.falseD.Compilationfails.E.Thecoderunswithnooutput.F.Anexceptionisthrownatruntime.

publicclassAlpha1{publicstaticvoidmain(String[]args){booleanflag;inti=0;do{flag=false;System.out.println(i++);flag=i10;continue;}while((flag)?true:false);}}Whatistheresult?() A.000000000B.0123456789C.Compilationfails.D.Thecoderunswithnooutput.E.Thecodeentersaninfiniteloop.F.Anexceptionisthrownatruntime.

下面程序片段的运行结果是()。 public static void main(String[] args) { int i=1, num=0; while(i<=10) { if (i%3==0) { num=num+1;} i++; } System.out.print(num); }A.3B.2C.1D.0

3、下面程序片段的运行结果是()。public static void main(String[] args) { int i=1, num=0; while(i<=10) { if (i%3==0) { num=num+1;} i++; } System.out.print(num); }A.3B.2C.1D.0

写出以下代码的输出结果: public class Test{ public static void main(String[] args){ int list[] = {1,2,3,4,5,6}; for(int i = 1; i < list.length; i++) list[i] = list[i - 1]; for(int i = 0; i < list.length; i++) System.out.print(list[i] + " "); } }

【单选题】以下代码的输出结果是_________。 public static void main(String[] args){ for(int i=1;i<=10;i++){ if(i%2==0 || i%5==0){ continue; } System.out.print(i+"t"); } }A.1B.1 3 4C.1 3 5 7 9D.1 3 7 9