常州酌乒文化传播有限公司

當(dāng)前位置:

JAVA認(rèn)證考試專(zhuān)業(yè)語(yǔ)言模擬試題小測(cè)天天練4

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

uestion: 19

Given the following fragment of code:

boolean m = true;

if ( m = false )

System.out.println(False);

else

System.out.println(True);

What is the result of the execution?

A. False

B. True

C. None

D. An error will occur when running.

Explanation:

= is the assignment operator. == is the compare operator. In this question the value of false is assigned to the variable m.

Correct Answer: A 19 of 60

Question: 20

Given the following code:

public class Test{

public static void main(String arg[]){

int i = 5;

do {

System.out.println(i);

} while (--i>5)

System.out.println(“finished”);

}

}

What will be output after execution?

A. 5

B. 4

C. 6

D. Finished

E. None

Explanation:

The expressions in the block of do/while loop will be executed at least once. If the condition of this loop is not met the loop will stop after once execution, otherwise, it will continue to loop until the condition is no met.

Correct Answer: A,D 20 of 60

編輯推薦:

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


(責(zé)任編輯:)

2頁(yè),當(dāng)前第1頁(yè)  第一頁(yè)  前一頁(yè)  下一頁(yè)
最近更新 考試動(dòng)態(tài) 更多>
金溪县| 六枝特区| 云和县| 隆子县| 营口市| 南漳县| 濮阳市| 泗阳县| 平陆县| 镇安县| 祁东县| 平谷区| 洛川县| 武城县| 西畴县| 鲜城| 德昌县| 阿城市| 宜宾县| 陵川县| 潮州市| 顺平县| 克拉玛依市| 五河县| 蕲春县| 宣恩县| 阿图什市| 昌图县| 杭州市| 图们市| 绍兴市| 哈巴河县| 大渡口区| 贵德县| 夏津县| 青海省| 兖州市| 清徐县| 清新县| 昭觉县| 武山县|