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

當前位置:

JAVA認證公共基礎(chǔ)知識指導練習題(2)

發(fā)表時間:2015/4/10 11:39:21 來源:互聯(lián)網(wǎng) 點擊關(guān)注微信:關(guān)注中大網(wǎng)校微信
關(guān)注公眾號

4:

1.10 What is the result of compiling and executing the following code?

public class ThreadTest extends Thread {

public void run() {

System.out.println("In run");

yield();  System.out.println("Leaving run");

}

public static void main(String args []) {

(new ThreadTest()).start();

}

}

A. The code fails to compile in the main() method.

B. The code fails to compile in the run() method.

C. Only the text "In run" will be displayed.

D. The text "In run" followed by "Leaving run" will be displayed.

E. The code compiles correctly, but nothing is displayed.

Answer: D

5:

1.12 Which of the following will definitely stop a thread from executing?A. wait()B. notify()C. yield()D. suspend()E. sleep()Answer: ACDE

6:

1.12 Which of the following will definitely stop a thread from executing?

A. wait()

B. notify()

C. yield()

D. suspend()

E. sleep()

Answer: ACDE

編輯推薦:

JAVA認證公共基礎(chǔ)知識指導練習題匯總

JAVA認證考試報考指南 / 更多JAVA考試模擬試題

(責任編輯:xy)

2頁,當前第1頁  第一頁  前一頁  下一頁
最近更新 考試動態(tài) 更多>
鄯善县| 安国市| 年辖:市辖区| 贺州市| 措美县| 霍城县| 顺平县| 石楼县| 西乌珠穆沁旗| 卢湾区| 溧阳市| 榆林市| 乾安县| 宁晋县| 句容市| 和政县| 陵川县| 平南县| 壶关县| 涟源市| 百色市| 隆德县| 霍邱县| 缙云县| 正阳县| 鹿邑县| 天柱县| 开平市| 大庆市| 新营市| 修文县| 岳西县| 巴林左旗| 吐鲁番市| 沙洋县| 秭归县| 宜川县| 龙游县| 静安区| 金乡县| 宜宾市|