网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
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.


参考答案

参考解析
解析: 暂无解析
更多 “单选题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.” 相关考题
考题 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.

考题 public class Threads2 implements Runnable {  public void nun() {  System.out.println(”run.”);  throw new RuntimeException(”Problem”);  }  public static void main(String[] args) {  Thread t = new Thread(new Threads2());  t.start();  System.out.println(”End of method.”);  }  }  Which two can be results?()A、 java.lang.RuntimeException: ProblemB、 run. java.lang.RuntimeException: ProblemC、 End of method. java.lang.RuntimeException: ProblemD、 End of method.  run.java.lang.RuntimeException: ProblemE、 run. java.lang.RuntimeException: Problem End of method.

考题 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.

考题 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.

考题 Which two code fragments will execute the method doStuff() in a separate thread?()A、 new Thread() { public void run() { doStuff(); } }B、 new Thread() { public void start() { doStuff(); } }C、 new Thread() { public void start() { doStuff(); } } .run();D、 new Thread() { public void run() { doStuff(); } } .start();E、 new Thread(new Runnable() { public void run() { doStuff(); } } ).run();F、 new Thread(new Runnable() { public void run() { doStuff(); } }).start();

考题 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.

考题 What happens when thread X executes a wait() method on object A, without owning object A’s lock?()  A、 Compilation fails.B、 An exception is thrown.C、 The wait() method has no effect.D、 Thread X receives the lock immediately.E、 Object A moves the thread to the wait pool.

考题 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.

考题 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 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.

考题 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.

考题 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 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.

考题 Which two CANNOT directly cause a thread to stop executing? ()  A、 Existing from a synchronized block.B、 Calling the wait method on an object.C、 Calling notify method on an object.D、 Calling read method on an InputStream object.E、 Calling the SetPriority method on a Thread object.

考题 Which two code fragments will execute the method doStuff() in a separate thread?()A、new Thread() {public void run() { doStuff(); }};B、new Thread() {public void start() { doStuff(); }};C、new Thread() {public void start() { doStuff(); }}.run();D、new Thread() {public void run() { doStuff(); }}.start();E、new Thread(new Runnable() {public void run() { doStuff(); }}).start();

考题 You are creating a Windows application for graphical image processing by using the .NET Framework 3.5. You create an image processing function and a delegate.You plan to invoke the image processing function by using the delegate.You need to ensure that the calling thread meets the following requirements:  (1)It is not blocked when the delegate is running   (2)It is notified when the delegate is complete What should you do?()A、Call the Invoke method of the delegate.B、Call the BeginInvoke and EndInvoke methods of the delegate in the calling thread.C、Call the BeginInvoke method by specifying a callback method to be executed when the delegate is complete.Call the EndInvoke method in the callback method.D、Call the BeginInvoke method by specifying a callback method to be executed when the delegate is complete.Call the EndInvoke method of the delegate in the calling thread.

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

考题 单选题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 two can directly cause a thread to stop executing?()AExiting from a synchronized block.BCalling the wait method on an object.CCalling the notify method on an object.DCalling the notifyAll method on an object.ECalling the setPriority method on a thread object.

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

考题 多选题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 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 creating a Windows Forms application by using the .NET Framework 3.5. The application requires a thread that accepts a single integer parameter.    You write the following code segment (Line numbers are included for reference only.) Thread myThread = new Thread(new ParameterizedThreadStart(DoWork)) ;  myThread.Start(100); You need to declare the method signature of the DoWork method.   Which method signature should you use?()A public void DoWork();B public void DoWork(int nCounter);C public void DoWork(object oCounter);D public void DoWork(Delegate oCounter);

考题 单选题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 two code fragments will execute the method doStuff() in a separate thread?()Anew Thread() {public void run() { doStuff(); }};Bnew Thread() {public void start() { doStuff(); }};Cnew Thread() {public void start() { doStuff(); }}.run();Dnew Thread() {public void run() { doStuff(); }}.start();Enew Thread(new Runnable() {public void run() { doStuff(); }}).start();

考题 单选题What happens when thread X executes a wait() method on object A, without owning object A’s lock?()A  Compilation fails.B  An exception is thrown.C  The wait() method has no effect.D  Thread X receives the lock immediately.E  Object A moves the thread to the wait pool.

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