一级做a爱片,色站综合,99偷拍视频精品一区二区,亚洲精品色无码AV

當(dāng)前位置:

JAVA認(rèn)證公共基礎(chǔ)知識(shí)指導(dǎo)練習(xí)題(3)

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

7:

Which of the following statements about threading are true?

A. You can only obtain a mutually exclusive lock on methods in a class that extends Thread or implements runnable.

B. You can obtain a mutually exclusive lock on any object.

C. You can't obtain a mutually exclusive lock on any object.

D. Thread scheduling algorithms are platform dependent.

Answer: BD

8:

Consider the following statement:

Thread myThread = new Thread();

Which of the following statements are true regarding myThread?

A. The thread myThread is now in a runnable state.

B. The thread myThread has a priority of 5.

C. On calling the start() method on myThread, the run method in the Thread class will be executed.

D. On calling the start() method on myThread, the run method in the calling class will be executed.

Answer: C

Note: the priority of myThread will be inherited from the Thread that called the constructor.

9:

What is the effect of issuing a wait() method on an object?(Mutiple)

1) If a notify() method has already been sent to that object then it has no effect

2) The object issuing the call to wait() will halt until another object sends a notify() or notifyAll() method

3) An exception will be raised

4) The object issuing the call to wait() will be automatically synchronized with any other objects using the receiving object.

ANSWER 1)

10:

Pick all the true statements below.

1) If a thread wants to call wait() on an object, the thread must own that object's lock.

2) There is a method that you can call on an instance of the Thread class that puts the instance to sleep for a specified  number of milliseconds.

3) At the moment when a thread is notified, it automatically gets the lock of the object for which it was waiting.

ANSWER 1

11:

1. class Z {

2.  public static void main(String[] args) {

3.   new Z();

4.  }

5.

6.  Z() {

7.   Z alias1 = this;

8.   Z alias2 = this;

9.   synchronized(alias1) {

10.   try {

11.   alias2.wait();

12.   System.out.println("DONE WAITING");

13.   }

14.   catch (InterruptedException e) {

15.   System.out.println("INTERRUPTED");

16.   }

17.   catch (Exception e) {

18.   System.out.println("OTHER EXCEPTION");

19.   }

20.   finally {

21.   System.out.println("FINALLY");

22.   }

23.   }

24.   System.out.println("ALL DONE");

25.  }

26. }

Mutiple:

1) Compiler error.

2) The application compiles but doesn't print anything.

3) The application prints "DONE WAITING".

4) The application prints "INTERRUPTED".

5) The application prints "OTHER EXCEPTION".

ANS: 2)

12:

What will happen when you attempt to compile and run the following code?

class MyThread extends Thread{

public void run(){

System.out.println("MyThread: run()");

}

public void start(){////注意,此方法重寫后,不再有CALL RUN()方法的功能。

System.out.println("MyThread: start()");

}

}

class MyRunnable implements Runnable{

public void run(){

System.out.println("MyRunnable: run()");

}

public void start(){//Runnable 并無(wú)此方法,所以,除非本類的對(duì)象可以CALL 它,否則,將CALL THREAD 的start()執(zhí)行run()

System.out.println("MyRunnable: start()");

}

}

public class MyTest {

public static void main(String args[]){

MyThread myThread = new MyThread();

MyRunnable myRunnable = new MyRunnable();

Thread thread = new Thread(myRunnable);

myThread.start();

thread.start();

}

}

A.prints: MyThread: start() followed by MyRunnable: run()

B.prints: MyThread: run() followed by MyRunnable: start()

C.prints: MyThread: start() follow

編輯推薦:

JAVA認(rèn)證公共基礎(chǔ)知識(shí)指導(dǎo)練習(xí)題匯總

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

(責(zé)任編輯:xy)

2頁(yè),當(dāng)前第1頁(yè)  第一頁(yè)  前一頁(yè)  下一頁(yè)
最近更新 考試動(dòng)態(tài) 更多>
国内精品久久久久久久试看| 日韩亚色| 伊人孕妇色| 99无码熟妇丰满人妻啪啪| 欧美综合2| 久久精品Com| 香蕉久久99| 一本一道AV无码中文字幕麻豆 | 亚洲自拍亚洲AV| 日本精品三级久久| 丁香五月综合中文| 国产精品99久久久久久猫咪| 欧美熟妇666| 激情福利视频导航| 亚洲免费成人电影| 去部队探亲被全队肉辣文| 欧美性爱视频区| 成人α级视频免费| 久久亚洲国产电影推荐| 亚洲另类一二三区| 密臀久久| 久久 不卡| 爱橙影院国产情侣| 欧美久久道| 高清无码小视频| 蜜桃视频一区二区三区在线观看 | 香港无码中文| 爱爱综合| av无码下载| 国产精品无码永久免费视频| 中文字幕av在线| 婷婷六月激情| 中文字幕日本欧美| 欧美图区色色天| 乱人伦中文视频在线| 日韩精品在线片| 风间精品一区二区三区| 18小视频在线免费看| 五月丁香偷拍视频| 免费看欧美一级特黄a大片| 尤物AV在线电影|