单选题Which method in the Thread class is used to create and launch a new thread of execution?()Aensp;Run();Bensp;Start();Censp;Execute();Densp;Run(Runnableensp;r);Eensp;Start(Runnableensp;r);Fensp;Execute(Threadensp;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);


参考解析

解析: 暂无解析

相关考题:

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.

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.

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.

In your web application,you need to execute a block of code whenever the session object is first created. Which design will accomplish this goal?()A、Create an HttpSessionListener class and implement the sessionInitialized method with that block ofcode.B、Create an HttpSessionActivationListener class and implement the sessionCreated method with thatblock of code.C、Create a Filter class, call the getSession(false) method, and if the result was null, then execute that block of code.D、Create an HttpSessionListener class and implement the sessionCreated method with that block of code.

可用于定义新线程类的方法有()。A、implement the Runnable interfaceB、add a run()method in the classC、create an instance of ThreadD、extend the Thread class

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.

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.

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

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.

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.

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.

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、 IDictionaryB、 IComparableC、 IComparerD、 IEqualityComparer

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.

单选题Under which circumstances will a thread stop?()AThe method waitforId() in class MediaTracker is called.BThe run() method that the thread is executing ends.CThe call to the start() method of the Thread object returns.DThe suspend() method is called on the Thread object.EThe wait() method is called on the Thread object.

单选题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 AB BC CD D

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

单选题Which class is used to specify a set of features to support on the XrnlReader object created by the Create method?()AXmlReaderSettingsBXmlSecureResolverCXmlValidatingReaderDXmlTextReaderSelectMany(c = c.CustomerAddresses).Count()

单选题Given that t1 is a reference to a live thread, which is true?()AThe Thread.sleep() method can take t1 as an argument.BThe Object.notify() method can take t1 as an argument.CThe Thread.yield() method can take t1 as an argument.DThe Thread.setPriority() method can take t1 as an argument.EThe Object.notify() method arbitrarily chooses which thread to notify.

多选题Which two CANNOT directly cause a thread to stop executing? ()ACalling the yield method.BCalling the wait method on an object.CCalling the notify method on an object.DCalling the notifyAll method on an object.ECalling the start method on another Thread object.

单选题Which methods from the String and StringBuffer classes modify the object on which they are called?()AThe charAt() method of the String class.BThe toUpperCase() method of the String class.CThe replace() method of the String class.DThe reverse() method of the StringBuffer class.EThe length() method of the StringBuffer class.

单选题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 IDictionaryB IComparableC IComparerD IEqualityComparer

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

单选题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?()AThe method must return a type of either IEnumerator or IEnumerable.BThe method must return a type of IComparable.CThe method must explicitly contain a collection.DThe method must be the only iterator in the class.

多选题Which two can be used to create a new Thread?()AExtend java.lang.Thread and override the run method.BExtend java.lang.Runnable and override the start method.CImplement java.lang.thread and implement the run method.DImplement java.lang.Runnable and implement the run method.EImplement java.lang.Thread and implement the start method.

多选题Which two statements are true about the hashCode method?()AThe hashCode method for a given class can be used to test for object equality and object inequality for that class.BThe hashCode method is used by the java.util.SortedSet collection class to order theelements within that set.CThe hashCode method for a given class can be used to test for object inequality, but NOT object equality, for that class.DThe only important characteristic of the values returned by a hashCode method is that the distribution of values must follow a Gaussian distribution.EThe hashCode method is used by the java.util.HashSet collection class to group the elements within that set into hash buckets for swift retrieval.

多选题Which statements concerning the methods notify() and notifyAll() are true?AInstances of class Thread have a method called notify().BA call to the method notify() will wake the thread that currently owns the monitor of the object.CThe method notify() is synchronized.DThe method notifyAll() is defined in class Thread.EWhen 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.

单选题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 AB BC CD D