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

當前位置:

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) 更多>
株洲县| 鹤壁市| 咸宁市| 通海县| 茂名市| 乐陵市| 南川市| 津市市| 黄山市| 舟曲县| 盐山县| 竹溪县| 榆中县| 南投县| 景洪市| 安龙县| 宁河县| 广德县| 定陶县| 柳州市| 鄂尔多斯市| 茂名市| 密山市| 乌拉特后旗| 石城县| 辽阳市| 安阳县| 株洲县| 山丹县| 台中县| 浑源县| 上杭县| 玉山县| 无极县| 涪陵区| 应城市| 盈江县| 黄骅市| 炎陵县| 思南县| 峨边|