网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
55.int[]x={1,2,3,4,5}; 56.inty[]=x; 57.System.out.println(y[2]); Whichistrue?()
- A、Line 57 will print the value 2.
- B、Line 57 will print the value 3.
- C、Compilation will fail because of an error in line 55.
- D、Compilation will fail because of an error in line 56.
参考答案
更多 “ 55.int[]x={1,2,3,4,5}; 56.inty[]=x; 57.System.out.println(y[2]); Whichistrue?() A、Line 57 will print the value 2.B、Line 57 will print the value 3.C、Compilation will fail because of an error in line 55.D、Compilation will fail because of an error in line 56.” 相关考题
考题
publicclassTestFive{privateintx;publicvoidfoo(){intcurrent=x;x=current+1;}publicvoidgo(){for(inti=0;i5;i++){newThread(){publicvoidrun(){foo();System.out.print(x+,);}}.start();}}}Whichtwochanges,takentogether,wouldguaranteetheoutput:1,2,3,4,5,?()A.Movetheline12printstatementintothefoo()method.B.Changeline7topublicsynchronizedvoidgo(){.C.Changethevariabledeclarationonline3toprivatevolatileintx;.D.Wrapthecodeinsidethefoo()methodwithasynchronized(this)block.E.Wraptheforloopcodeinsidethego()methodwithasynchronizedblocksynchronized(this){//forloopcodehere}.
考题
下列数组的初始化正确的是_________。
A.int[]score=newint[5]{1,2,3,4,5};B.int[5]score=newint[]{1,2,3,4,5};C.intscore={1,2,3,4,5};D.int[]score=newint[5];
考题
下列程序的运行结果是()。includevoid sub(int*s,int*y){static int m=4;*y=s[0];m++;}
下列程序的运行结果是( )。 #include<stdio.h> void sub(int*s,int*y) {static int m=4; *y=s[0]; m++; } void main() {int a[]={1,2,3,4,5},k; int x; printf("\n"); for(k=0;k<=4;k++) {sub(a,x); printf("%d,",x); } }A.1,1,1,1,1,B.1,2,3,4,5,C.0,0,0,0,0,D.4,4,4,4,4,
考题
以下( )代码,能够对数组正确初始化(或者是默认初始化)。A、int[]a;B、a={1,2,3,4,5};C、int[]a=newint[5]{1,2,3,4,5};D、int[]a=newint[5];
考题
在scala中对于以下2个列表的操作,那些说法说法正确vart=List(1,2,3)vart2=List(4,5)()A、vart3=t++t2得到List(1,2,3,4,5)B、vart3=List.concat(t,t2)得到List(1,2,3,4,5)C、vart3=t:::t2得到List(1,2,3,4,5)D、vart3=t.:::(t2)得到List(1,2,3,4,5)
考题
单选题55.int[]x={1,2,3,4,5}; 56.inty[]=x; 57.System.out.println(y[2]); Whichistrue?()A
Line 57 will print the value 2.B
Line 57 will print the value 3.C
Compilation will fail because of an error in line 55.D
Compilation will fail because of an error in line 56.
考题
多选题Which two code fragments are most likely to cause a StackOverflowError?()Aint []x = {1,2,3,4,5};for(int y = 0; y 6; y++) System.out.println(x[y]);Bstatic int[] x = {7,6,5,4};static { x[1] = 8;x[4] = 3; }Cfor(int y = 10; y 10; y++)doStuff(y);Dvoid doOne(int x) { doTwo(x); }void doTwo(int y) { doThree(y); }void doThree(int z) { doTwo(z); }Efor(int x = 0; x 1000000000; x++) doStuff(x);Fvoid counter(int i) { counter(++i); }
考题
填空题已知f(x)=2x3+5,则f[1,2,3,4]=(),f[1,2,3,4,5]=()。
热门标签
最新试卷