Calling the yield method.
Calling the wait method on an object.
Calling the notify method on an object.
Calling the notifyAll method on an object.
Calling the start method on another Thread object.
第1题:
Which statements concerning the methods notify() and notifyAll() are true?
第2题:
Given: foo and bar are public references available to many other threads, foo refers to a Thread and bar is an Object. The thread foo is currently executing bar.wait(). From another thread, what provides the most reliable way to ensure that foo will stop executing wait()?()
第3题:
Which two can directly cause a thread to stop executing?()
第4题:
What can cause a thread to become non-runnable?()
第5题:
Which statement is true?()
第6题:
Given: foo and bar are public references available to many other threads. foo refers to a Thread and bar is anObject. The thread foo is currently executing bar.wait(). From another thread,what provides the most reliable wayto ensure that foo will stop executing wait()?
第7题:
The method waitforId() in class MediaTracker is called.
The run() method that the thread is executing ends.
The call to the start() method of the Thread object returns.
The suspend() method is called on the Thread object.
The wait() method is called on the Thread object.
第8题:
Calling the yield method.
Calling the wait method on an object.
Calling the notify method on an object.
Calling the notifyAll method on an object.
Calling the start method on another Thread object.
第9题:
foo.notify();
bar.notify();
foo.notifyAll();
Thread.notify();
bar.notiFYAll();
Object.notify();
第10题:
Instances of class Thread have a method called notify().
A call to the method notify() will wake the thread that currently owns the monitor of the object.
The method notify() is synchronized.
The method notifyAll() is defined in class Thread.
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.
第11题:
Existing from a synchronized block.
Calling the wait method on an object.
Calling notify method on an object.
Calling read method on an InputStream object.
Calling the SetPriority method on a Thread object.
第12题:
Extend java.lang.Thread and override the run method.
Extend java.lang.Runnable and override the start method.
Implement java.lang.thread and implement the run method.
Implement java.lang.Runnable and implement the run method.
Implement java.lang.Thread and implement the start method.
第13题:
Under which circumstances will a thread stop?()
第14题:
Given that t1 is a reference to a live thread, which is true?()
第15题:
foo and bar are public references available to many other threads. foo refers to a Thread and bar is an Object. The thread foo is currently executing bar.wait(). From another thread, which statement is the most reliable way to ensue that foo will stop executing wait()?
第16题:
Which two can be used to create a new Thread?()
第17题:
Which two CANNOT directly cause a thread to stop executing? ()
第18题:
Which two statements are true?()
第19题:
Exiting from a synchronized block.
Calling the wait method on an object.
Calling the notify method on an object.
Calling the notifyAll method on an object.
Calling the setPriority method on a thread object.
第20题:
foo.notify();
bar.notify();
foo.notifyAll();
Thread.notify();
bar.notifyAll();
第21题:
Exiting from a synchronized block.
Calling the wait method on an object.
Calling the notify method on an object.
Calling the notifyAll method on an object.
第22题:
It is possible to synchronize static methods.
When a thread has yielded as a result of yield(), it releases its locks.
When a thread is sleeping as a result of sleep(), it releases its locks.
The Object.wait() method can be invoked only from a synchronized context.
The Thread.sleep() method can be invoked only from a synchronized context.
When the thread scheduler receives a notify() request, and notifies a thread, that thread immediately releases its lock.
第23题:
foo.notify();
bar.notify();
foo.notifyAll();
Thread.notify();
bar.notifyAll();
Object.notify();
第24题:
This code may throw an InterruptedException.
This code may throw an IllegalStateException.
This code may throw a TimeoutException after ten minutes.
This code will not compile unless “obj.wait()” is replaced with “((Thread) obj).wait()”.
Reversing the order of obj.wait() and obj.notify() may cause this method to complete normally.
A call to notify() or notifyAll() from another thread may cause this method to complete normally.