单选题Given that t1 is a reference to a live thread, which is true?()A The Thread.sleep() method can take t1 as an argument.B The Object.notify() method can take t1 as an argument.C The Thread.yield() method can take t1 as an argument.D The Thread.setPriorit

题目
单选题
Given that t1 is a reference to a live thread, which is true?()
A

The Thread.sleep() method can take t1 as an argument.

B

The Object.notify() method can take t1 as an argument.

C

The Thread.yield() method can take t1 as an argument.

D

The Thread.setPriority() method can take t1 as an argument.

E

The Object.notify() method arbitrarily chooses which thread to notify.

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

Given:Which two can be results?()

A. java.lang.RuntimeException: Problem

B. run.java.lang.RuntimeException: Problem

C. End of method.java.lang.RuntimeException: Problem

D. End of method.run.java.lang.RuntimeException: Problem

E. run.java.lang.RuntimeException: Problem End of method.


参考答案:D, E

第2题:

10. class Foo {  11. static void alpha() { /* more code here */ }  12. void beta() { /* more code here */ }  13. }  Which two are true?()

  • A、 Foo.beta() is a valid invocation of beta().
  • B、 Foo.alpha() is a valid invocation of alpha().
  • C、 Method beta() can directly call method alpha().
  • D、 Method alpha() can directly call method beta().

正确答案:B,C

第3题:

Can journalists take photos at the press conference to be held before the performance?

A.Yes, they can. But they’ve got to take photos in a certain place

B.Yes, they can. But they’ve got to take photos in designated places.

C.Yes, they can. But they have to find a suitable place

D.Yes, they can. But they’ve got to take photos at lower places.


正确答案:B

第4题:

Given that t1 is a reference to a live thread, which is true?()

  • A、The Thread.sleep() method can take t1 as an argument.
  • B、The Object.notify() method can take t1 as an argument.
  • C、The Thread.yield() method can take t1 as an argument.
  • D、The Thread.setPriority() method can take t1 as an argument.
  • E、The Object.notify() method arbitrarily chooses which thread to notify.

正确答案:E

第5题:

Which two of statements are true?()

  • A、It is possible to synchronize static methods.
  • B、When a thread has yielded as a result of yield(), it releases its locks.
  • C、When a thread is sleeping as a result of sleep(), it releases its locks.
  • D、The Object.wait() method can be invoked only from a synchronized context.
  • E、The Thread.sleep() method can be invoked only from a synchronized context.
  • F、When the thread scheduler receives a notify() request, and notifies a thread, that thread immediately releases its lock.

正确答案:A,D

第6题:

Which two statements are true about voice ports on a router? ()

  • A、 Calls to the PSTN can be made via the use of FXO or T1/E1 trunk ports.
  • B、 Calls to the PSTN can be made via FXS or T1/E1 trunk ports.
  • C、 Analog and IP phones can be connected to the VoIP network via FXO or T1/E1 trunk ports.
  • D、 Calls between analog phones that are attached to the FXS ports in a VoIP network can be completely processed by voice-enabled routers.

正确答案:A,D

第7题:

What is the name of the method that threads can use to pause their execution until signalled to continue by another thread? () Fill in the name of the method (do not include a parameter list).


正确答案:"wait"

第8题:

Given that t1 is a reference to a live thread, which is true?()

A.The Thread.sleep() method can take t1 as an argument.

B.The Object.notify() method can take t1 as an argument.

C.The Thread.yield() method can take t1 as an argument.

D.The Thread.setPriority() method can take t1 as an argument.

E.The Object.notify() method arbitrarily chooses which thread to notify.


参考答案:E

第9题:

Which statements concerning the methods notify() and notifyAll() are true?  

  • A、Instances of class Thread have a method called notify().
  • B、A call to the method notify() will wake the thread that currently owns the monitor of the object.
  • C、The method notify() is synchronized.
  • D、The method notifyAll() is defined in class Thread.
  • E、When there is more than one thread waiting to obtain the monitor of an object, there is no way to be     sure which thread will be notified by the notify() method.

正确答案:A,E

第10题:

It is desirable that a certain method within a certain class can only be accessed by classes that are defined within the same package as the class of the method. How can such restrictions be enforced?()  

  • A、Mark the method with the keyword public.
  • B、Mark the method with the keyword protected.
  • C、Mark the method with the keyword private.
  • D、Mark the method with the keyword package.
  • E、Do not mark the method with any accessibility modifiers.

正确答案:E

更多相关问题