单选题Which method in the Thread class is used to create and launch a new thread of execution?()A  Run();B  Start();C  Execute();D  Run(Runnable r);E  Start(Runnable r);F  Execute(Thread t);

题目
单选题
Which method in the Thread class is used to create and launch a new thread of execution?()
A

 Run();

B

 Start();

C

 Execute();

D

 Run(Runnable r);

E

 Start(Runnable r);

F

 Execute(Thread t);


相似考题

2. Your web application requires the adding and deleting of many session attributes during a complex usecase. A bug report has come in that indicates that an important session attribute is being deleted too soonand a NullPointerException is being thrown several interactions after the fact. You have decided to create asession event listener that will log when attributes are being deleted so you can track down when theattribute is erroneously being deleted. Which listener class will accomplish this debugging goal?()A、Create an HttpSessionAttributeListener class and implement the attributeDeleted method and log the attribute name using the getName method on the event object.B、Create an HttpSessionAttributeListener class and implement the attributeRemoved method and log the attribute name using the getName method on the event object.C、Create an SessionAttributeListener class and implement the attributeRemoved method and log the attribute name using the getAttributeName method on the event object.D、Create an SessionAttributeListener class and implement the attributeDeleted method and log the attribute name using the getAttributeName method on the event object.

更多“Which method in the Thread class is used to create and launc”相关问题
  • 第1题:

    可用于定义新线程类的方法有()。

    • A、implement the Runnable interface
    • B、add a run()method in the class
    • C、create an instance of Thread
    • D、extend the Thread class

    正确答案:A,D

  • 第2题:

    Under which circumstances will a thread stop?()  

    • A、The method waitforId() in class MediaTracker is called.
    • B、The run() method that the thread is executing ends.
    • C、The call to the start() method of the Thread object returns.
    • D、The suspend() method is called on the Thread object.
    • E、The wait() method is called on the Thread object.

    正确答案:B

  • 第3题:

    Which methods from the String and StringBuffer classes modify the object on which they are called?()  

    • A、The charAt() method of the String class.
    • B、The toUpperCase() method of the String class.
    • C、The replace() method of the String class.
    • D、The reverse() method of the StringBuffer class.
    • E、The length() method of the StringBuffer class.

    正确答案:D

  • 第4题:

    You are developing a custom-collection class.You need to create a method in your class. You need to ensure that the method you create in your class returns a type that is compatible with the Foreach statement. Which criterion should the method meet?()

    • A、The method must return a type of either IEnumerator or IEnumerable.
    • B、The method must return a type of IComparable.
    • C、The method must explicitly contain a collection.
    • D、The method must be the only iterator in the class.

    正确答案:A

  • 第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题:

    单选题
    You work as an application developer at Certkiller .com. Certkiller .com has asked you to create a multi-threaded application, which executes a critical database  backup operation on an hourly basis. You define this operation with the following code:  public void BackupDB () {  //Implementation code }  You then create a Thread object for the purpose of invoking this method.  You need to ensure that the thread is scheduled for execution before any other thread at runtime.What should you do?()
    A

    A

    B

    B

    C

    C

    D

    D


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

  • 第7题:

    单选题
    Which class is used to specify a set of features to support on the XrnlReader object created by the Create method?()
    A

    XmlReaderSettings

    B

    XmlSecureResolver

    C

    XmlValidatingReader

    D

    XmlTextReaderSelectMany(c => c.CustomerAddresses).Count()


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

  • 第8题:

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

    Calling the yield method.

    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 start method on another Thread object.


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

  • 第9题:

    单选题
    You work as an application developer at Certkiller .com. You are developing a collection class named ClientCollection, which is to be used for storing the names of Certkiller .com’s clients that are situated in various geographical areas. These client names are represented by the Client class. You are planning to create a method named SortClients in the ClientCollection class to arrange Client objects in ascending order. You need to ensure that the appropriate interface is implemented by the Client class to allow sorting.What interface should be used?()
    A

     IDictionary

    B

     IComparable

    C

     IComparer

    D

     IEqualityComparer


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

  • 第10题:

    单选题
    Which statement is true?()
    A

     If only one thread is blocked in the wait method of an object, and another thread executes the modify on that same object, then the first thread immediately resumes execution.

    B

     If a thread is blocked in the wait method of an object, and another thread executes the notify method on the same object, it is still possible that the first thread might never resume execution.

    C

     If a thread is blocked in the wait method of an object, and another thread executes the notify method on the same object, then the first thread definitely resumes execution as a direct and sole  consequence of the notify call.

    D

     If two threads are blocked in the wait method of one object, and another thread executes the notify method on the same object, then the first thread that executed the wait call first definitely resumes execution as a direct and sole consequence of the notify call.


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

  • 第11题:

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

  • 第12题:

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


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

  • 第13题:

    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

  • 第14题:

    Which method in the Thread class is used to create and launch a new thread of execution?()

    • A、 Run();
    • B、 Start();
    • C、 Execute();
    • D、 Run(Runnable r);
    • E、 Start(Runnable r);
    • F、 Execute(Thread t);

    正确答案:B

  • 第15题:

    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

  • 第16题:

    You work as an application developer at Certkiller .com. You are developing a collection class named ClientCollection, which is to be used for storing the names of Certkiller .com’s clients that are situated in various geographical areas. These client names are represented by the Client class. You are planning to create a method named SortClients in the ClientCollection class to arrange Client objects in ascending order. You need to ensure that the appropriate interface is implemented by the Client class to allow sorting.What interface should be used?()

    • A、 IDictionary
    • B、 IComparable
    • C、 IComparer
    • D、 IEqualityComparer

    正确答案:B

  • 第17题:

    单选题
    Under which circumstances will a thread stop?()
    A

    The method waitforId() in class MediaTracker is called.

    B

    The run() method that the thread is executing ends.

    C

    The call to the start() method of the Thread object returns.

    D

    The suspend() method is called on the Thread object.

    E

    The wait() method is called on the Thread object.


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

  • 第18题:

    单选题
    public class TestSeven extends Thread {  private static int x;  public synchronized void doThings() {  int current = x;  current++;  x = current;  }  public void run() {  doThings();  }  }  Which is true?()
    A

     Compilation fails.

    B

     An exception is thrown at runtime.

    C

     Synchronizing the run() method would make the class thread-safe.

    D

     The data in variable “x” are protected from concurrent access problems.

    E

     Declaring the doThings() method as static would make the class thread-safe.

    F

     Wrapping the statements within doThings() in a synchronized(new Object()) {} block would make the class thread-safe.


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

  • 第19题:

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

  • 第20题:

    单选题
    Which methods from the String and StringBuffer classes modify the object on which they are called?()
    A

    The charAt() method of the String class.

    B

    The toUpperCase() method of the String class.

    C

    The replace() method of the String class.

    D

    The reverse() method of the StringBuffer class.

    E

    The length() method of the StringBuffer class.


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

  • 第21题:

    单选题
    Which method in the Thread class is used to create and launch a new thread of execution?()
    A

     Run();

    B

     Start();

    C

     Execute();

    D

     Run(Runnable r);

    E

     Start(Runnable r);

    F

     Execute(Thread t);


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

  • 第22题:

    单选题
    You are developing a custom-collection class.You need to create a method in your class. You need to ensure that the method you create in your class returns a type that is compatible with the Foreach statement. Which criterion should the method meet?()
    A

    The method must return a type of either IEnumerator or IEnumerable.

    B

    The method must return a type of IComparable.

    C

    The method must explicitly contain a collection.

    D

    The method must be the only iterator in the class.


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

  • 第23题:

    多选题
    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 theelements within that set.

    C

    The hashCode method for a given class can be used to test for object inequality, but NOT object equality, 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,B
    解析: 暂无解析

  • 第24题:

    单选题
    You need to create a class definition that is interoperable along with COM.You need to ensure that COM applications can create instances of the class and can call the GetAddress method. Which code segment should you use?()
    A

    A

    B

    B

    C

    C

    D

    D


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