itgle.com

单选题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.


相似考题
更多“单选题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”相关问题
  • 第1题:

    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

  • 第2题:

    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

  • 第3题:

    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

  • 第4题:

    Which two can directly cause a thread to stop executing?() 

    • A、 Exiting from a synchronized block.
    • B、 Calling the wait method on an object.
    • C、 Calling the notify method on an object.
    • D、 Calling the notifyAll method on an object.
    • E、 Calling the setPriority method on a thread object.

    正确答案:B,E

  • 第5题:

    Which two can be used to create a new Thread?()   

    • A、 Extend java.lang.Thread and override the run method.
    • B、 Extend java.lang.Runnable and override the start method.
    • C、 Implement java.lang.thread and implement the run method.
    • D、 Implement java.lang.Runnable and implement the run method.
    • E、 Implement java.lang.Thread and implement the start method.

    正确答案:A,D

  • 第6题:

    Which three statements are true?()

    • A、A final method in class X can be abstract if and only if X is abstract.
    • B、A protected method in class X can be overridden by any subclass of X.
    • C、A private static method can be called only within other static methods in class X.
    • D、A non-static public final method in class X can be overridden in any subclass of X.
    • E、A public static method in class X can be called by a subclass of X without explicitly referencing the class X.
    • F、A method with the same signature as a private final method in class X can be implemented in a subclass of X.
    • G、A protected method in class X can be overridden by a subclass of X only if the subclass is in the same package as X.

    正确答案:B,E,F

  • 第7题:

    多选题
    Which two can directly cause a thread to stop executing?()
    A

    Exiting from a synchronized block.

    B

    Calling the wait method on an object.

    C

    Calling the notify method on an object.

    D

    Calling the notifyAll method on an object.

    E

    Calling the setPriority method on a thread object.


    正确答案: D,C
    解析: 暂无解析

  • 第8题:

    填空题
    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"
    解析: 暂无解析

  • 第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.


    正确答案: D,B
    解析: 暂无解析

  • 第10题:

    多选题
    Which two statements are true about the hashCode method?()
    A

    The hashCode method for a given class can be used to test for object equality and object inequality for that class.

    B

    The hashCode method is used by the java.util.SortedSet collection class to order the elements within that set.

    C

    The hashCode method for a given class can be used to test for object inequality, but NOT objecte quality, for that class.

    D

    The only important characteristic of the values returned by a hashCode method is that the distribution of values must follow a Gaussian distribution.

    E

    The hashCode method is used by the java.util.HashSet collection class to group the elements within that set into hash buckets for swift retrieval.


    正确答案: E,D
    解析: 暂无解析

  • 第11题:

    单选题
    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.


    正确答案: D
    解析: 暂无解析

  • 第12题:

    单选题
    Which of the following is true regarding the use of switches and hubs for network connectivity?()
    A

    Switches take less time to process frames than hubs take.

    B

    Switches do not forward broadcasts.

    C

    Hubs can filter frames.

    D

    Using hubs can increase the amount of bandwidth available to hosts.

    E

    Switches increase the number of collision domains in the network.


    正确答案: E
    解析: 暂无解析

  • 第13题:

    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"

  • 第14题:

    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

  • 第15题:

    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

  • 第16题:

    What can cause a thread to become non-runnable?()

    • A、 Exiting from a synchronized block.
    • B、 Calling the wait method on an object.
    • C、 Calling the notify method on an object.
    • D、 Calling the notifyAll method on an object.

    正确答案:B

  • 第17题:

    Which two statements are true about using the isUserInRole method to implement security in a Java EEapplication?()

    • A、It can be invoked only from the doGet or doPost methods.
    • B、It can be used independently of the getRemoteUser method.
    • C、Can return "true" even when its argument is NOT defined as a valid role name in the deployment descriptor.
    • D、Using the isUserInRole method overrides any declarative authentication related to the method in which it is invoked.

    正确答案:B,C

  • 第18题:

    Which two statements are true about the hashCode method?()

    • A、The hashCode method for a given class can be used to test for object equality and object inequality for that class.
    • B、The hashCode method is used by the java.util.SortedSet collection class to order the elements within that set.
    • C、The hashCode method for a given class can be used to test for object inequality, but NOT objecte quality, for that class.
    • D、The only important characteristic of the values returned by a hashCode method is that the distribution of values must follow a Gaussian distribution.
    • E、The hashCode method is used by the java.util.HashSet collection class to group the elements within that set into hash buckets for swift retrieval.

    正确答案:C,E

  • 第19题:

    单选题
    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.


    正确答案: A
    解析: 暂无解析

  • 第20题:

    单选题
    What can cause a thread to become non-runnable?()
    A

     Exiting from a synchronized block.

    B

     Calling the wait method on an object.

    C

     Calling the notify method on an object.

    D

     Calling the notifyAll method on an object.


    正确答案: D
    解析: 暂无解析

  • 第21题:

    多选题
    Which two can be used to create a new Thread?()
    A

    Extend java.lang.Thread and override the run method.

    B

    Extend java.lang.Runnable and override the start method.

    C

    Implement java.lang.thread and implement the run method.

    D

    Implement java.lang.Runnable and implement the run method.

    E

    Implement java.lang.Thread and implement the start method.


    正确答案: D,B
    解析: 暂无解析

  • 第22题:

    单选题
    Which of the following is NOT true of the treatment with more and more understanding of phobia?
    A

    New medicines that can get rid of the fear in the brain.

    B

    New psychological methods that can help people not fear.

    C

    New medicines that can remove phobia in six-hour period.

    D

    The method that can help people overcome phobia by facing fearful things.


    正确答案: D
    解析:
    是非题。第一段前两行提到“exposure therapy that can stomp out a lifetime phobia in a single six-hour session”(在短短的六小时内,exposure therapy就能重创长期的恐惧症)。此处的“重创”,与选项C提到的remove“根除”表达的程度不同。因此选项C与原文不符。

  • 第23题:

    多选题
    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
    解析: 暂无解析

  • 第24题:

    多选题
    Which two statements are true about using the isUserInRole method to implement security in a Java EEapplication?()
    A

    It can be invoked only from the doGet or doPost methods.

    B

    It can be used independently of the getRemoteUser method.

    C

    Can return true even when its argument is NOT defined as a valid role name in the deployment descriptor.

    D

    Using the isUserInRole method overrides any declarative authentication related to the method in which it is invoked.


    正确答案: D,C
    解析: 暂无解析