interfaceDeclareStuff{publicstaticfinalintEASY=3;voiddoStuff(intt);}publicclassTestDeclareimplementsDeclareStuff{publicstaticvoidmain(String[]args){intx=5;newTestDeclare().doStuff(++x);}voiddoStuff(ints){s+=EASY+++s;System.out.println(”s+s);}}Whatistheresult?()
A.s14
B.s16
C.s10
D.Compilationfails.
E.Anexceptionisthrownatruntime.
第1题:
填空(只能填一条语句),实现a,b的值的交换。 int t,a=3,b=4; () a=b; b=t;
第2题:
【单选题】以下数组初始化形式正确的是
A.int t1[ ][ ]={{1,2},{3,4},{5,6}}
B.int t2[ ][ ]={1,2.3,4,5,6}
C.int t3[3][2]={1,2.3,4,5,6}
D.int t4[ ][ ]; t4={1,2.3,4,5,6}
第3题:
以下数组初始化形式正确的是()
A.int t1[][]={{1,2},{3,4},{5,6}}
B.int t2[][]={1,2,3,4,5,6}
C.int t3[3][2]={1,2,3,4,5,6}
D.int t4[][] t4={1,2,3,4,5,6};
第4题:
以下数组初始化形式正确的是:
A.int t1[][]={{1,2},{3,4},{5,6}};
B.int t2[][]={1,2,3,4,5,6};
C.int t3[3][2]={1,2,3,4,5,6};
D.int t4[][]; t4={1,2,3,4,5,6};
第5题:
【单选题】以下数组初始化形式错误的是
A.int t1[ ]={1,2.3,4,5,6}
B.int t2[ ][ ]={{1,2},{3,4},{5,6}}
C.int t3[ ][ ]=new int[3][ ]; t3[0]=new int[3]
D.int t4[ ][ ]=new int[ ][ 3];