广元煌褂旅行社

當(dāng)前位置:

Java考試格林模擬試題3

發(fā)表時(shí)間:2015/9/14 15:01:13 來(lái)源:互聯(lián)網(wǎng) 點(diǎn)擊關(guān)注微信:關(guān)注中大網(wǎng)校微信
關(guān)注公眾號(hào)

question 11)

what will be the result of attempting to compile and run the following code?

abstract class minebase { abstract void amethod(); static int i;}public class mine extends minebase { public static void main(string argv[]){ int[] ar=new int[5]; for(i=0;i < ar.length;i++) system.out.println(ar[i]); }}

1) a sequence of 5 0’s will be printed

2) error: ar is used before it is initialized

3) error mine must be declared abstract

4) indexoutofboundes error

question 12)

what will be printed out if you attempt to compile and run the following code ?

int i=1; switch (i) { case 0: system.out.println("zero"); break; case 1: system.out.println("one"); case 2: system.out.println("two"); default: system.out.println("default"); }

1) one

2) one, default

3) one, two, default

4) default

question 13)

what will be printed out if you attempt to compile and run the following code?

int i=9;switch (i) { default: system.out.println("default"); case 0: system.out.println("zero"); break; case 1: system.out.println("one"); case 2: system.out.println("two");}

1) default

2) default, zero

3) error default clause not defined

4) no output displayed

編輯推薦:

JAVA認(rèn)證考試報(bào)考指南 / 更多JAVA考試模擬試題

(責(zé)任編輯:zyc)

2頁(yè),當(dāng)前第1頁(yè)  第一頁(yè)  前一頁(yè)  下一頁(yè)
最近更新 考試動(dòng)態(tài) 更多>
怀仁县| 安远县| 德清县| 玉林市| 织金县| 凭祥市| 册亨县| 松滋市| 呼玛县| 达孜县| 芷江| 札达县| 天门市| 邢台县| 茂名市| 双江| 尼玛县| 新沂市| 普安县| 安吉县| 红原县| 米林县| 应用必备| 濮阳县| 景东| 岱山县| 泰和县| 汨罗市| 宁晋县| 西乌珠穆沁旗| 攀枝花市| 永顺县| 通化县| 晋中市| 灵台县| 赣榆县| 宝兴县| 长治县| 高平市| 龙泉市| 江安县|