广元煌褂旅行社

當前位置:

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) 更多>
辉南县| 睢宁县| 蓝田县| 安远县| 临高县| 潮州市| 卢氏县| 石狮市| 兰州市| 武汉市| 伊吾县| 秭归县| 临夏市| 聂荣县| 交城县| 德兴市| 合江县| 宝山区| 南昌县| 什邡市| 衡山县| 佛教| 东乡族自治县| 宝山区| 无极县| 彩票| 南部县| 玉环县| 巨鹿县| 历史| 平塘县| 壤塘县| 淮南市| 沽源县| 万盛区| 平山县| 永嘉县| 师宗县| 托里县| 玉屏| 北京市|