网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
classTestApp{publicstaticvoidmain(String[]args){System.out.println(multiply(2,3,4,5));}publicintmultiply(int...nums){intresult=1;for(intx:nums)result*=x;returnresult;}}程序运行后的输出是哪项?()
A.120
B.24
C.14
D.编译错误
参考答案
更多 “ classTestApp{publicstaticvoidmain(String[]args){System.out.println(multiply(2,3,4,5));}publicintmultiply(int...nums){intresult=1;for(intx:nums)result*=x;returnresult;}}程序运行后的输出是哪项?() A.120B.24C.14D.编译错误 ” 相关考题
考题
下面程序段的输出结果是( )。 public class Test { public static void main ( String[] args) { int result=0; for ( int i=1;i<=5;i++) { if ( i%2==0 ) continue; result + =i; } System. out. println ("result is " + result ); } }A.result is 7B.result is 8C.result is 9D.result is 10
考题
classDemoApp{publicstaticvoidmain(String[]args){intx=5;inty=++x+x++;System.out.println(y=”+y+”,x=”+x);}}以上程序运行后的输出结果是哪项?()
A.y=10,x=5B.y=11,x=6C.y=12,x=7D.y=11,x=7
考题
classTestApp{publicstaticvoidmain(String[]args){System.out.println(multiply(2,3,4,5));}publicintmultiply(int…nums){intresult=1;for(intx:nums)result*=x;//result=result*x;returnresult;}}2、6、24、120程序运行后的输出是哪项?()A.14B.编译错误C.120D.24
考题
程序:classTestApp{publicstaticvoidmain(String[]args){System.out.println(multiply(2,3,4,5));}publicintmultiply(int[]nums){intresult=1;for(intx:nums)result*=x;returnresult;}}程序运行后的输出是哪项?()
A.14B.编译错误C.120D.24
考题
程序: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;i5;i++)System.out.print(i+1);System.out.println(i);}}上述程序运行后的结果是哪项?()
A.123456B.123455C.123450D.编译错误
考题
现有:classTestApp{publicstaticvoidmain(String[]args){int[5]myarray={10,11,12,13,14);intsum=0;for(intx:myarray)sum+=x;System.out.println(sum=+sum);}}上述程序运行后的结果是哪项?()
A.sum=10B.sum=70C.sum=60D.运行时抛出异常
考题
程序:classTestApp{publicstaticvoidmain(String[]args){intx=6;if(xl)System.out.println(xl);elseif(x5)System.out.println(x5);elseif(x10)System.out.println(xSystem.out.println(x29);elseSystem.out.println(以上都不是”);}}上述程序运行后的结果是哪项?()A.x5B.xlC.x10D.x29
考题
现有:classTestApp{publicstaticvoidmain(String[]args){for(inti=0;iif(i==3)break;System.out.print(i);}}}程序运行后的输出是哪项?()
A.0123B.012456789C.0123456789D.012
热门标签
最新试卷