欧美精品在欧美一区二区少妇,久久久久成人影视,99热在线精品呀,草莓视频手机在线观看

當(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) 更多>
骚妇视频在线网| 亚洲va国产日韩欧美精品| 中美午码| 中文字幕在线永久| 亚洲毛片A级无码| 久久88综合亚洲精品| 无码 一区二区三区| 欧美日韩激情一区| 国产妓女一级在线| 人人交人人| 欧美日韩国产在线客服| 悠悠色影视| 就要干就要操就要射| 久久久久青草线蕉亚洲| 97无码精品人妻一区二区三区| 国产精品久久6| 激情av在线小说| 国产伦人伦偷精品视频| 人人人操人人人人妻| 欧美老妇人与禽交| 国产v亚洲v天堂a无码| 丁香少妇激情综合se| 国产中文字幕色| 奇米七七七久久久| 精品毛片A级蜜桃| 成人亚洲欧美日韩| 大香蕉网色色| 无码人妻3P| 精品白浆| 亚洲激情综合色图| 亚洲欧美日韩综合久久久久| 久久精品兔费| 久久亚洲精品无码系列| 亚洲激情无码人妻| 五月丁香激情综合啪啪| 欧洲亚洲免费看| 丁香激情综合| 亚洲另类小说网| 久久99热精品免费观看牛牛| 97美女在线观看| 国产精品久久人人做人人爽|