广元煌褂旅行社

當前位置:

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) 更多>
永德县| 克什克腾旗| 登封市| 景宁| 邹平县| 临夏县| 高尔夫| 叙永县| 溧水县| 高唐县| 漳州市| 盐山县| 扶绥县| 汝城县| 曲水县| 逊克县| 庆城县| 海口市| 乐平市| 咸宁市| 会昌县| 东乡族自治县| 墨脱县| 潜江市| 广水市| 巨野县| 芷江| 五河县| 喜德县| 濉溪县| 海原县| 上饶县| 家居| 武冈市| 临沭县| 鄂尔多斯市| 色达县| 东莞市| 亚东县| 宜宾县| 历史|