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.
第1题:
Which two of statements are true?()
第2题:
Under which circumstances will a thread stop?()
第3题:
Given that t1 is a reference to a live thread, which is true?()
第4题:
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()?
第5题:
Which two can be used to create a new Thread?()
第6题:
Which two CANNOT directly cause a thread to stop executing? ()
第7题:
Which two statements are true?()
第8题:
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.
第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题:
It is possible for more than two threads to deadlock at once.
The JVM implementation guarantees that multiple threads cannot enter into a deadlocked state.
Deadlocked threads release once their sleep() method's sleep duration has expired.
Deadlocking can occur only when the wait(), notify(), and notifyAll() methods are used incorrectly.
It is possible for a single-threaded application to deadlock if synchronized blocks are used incorrectly.
If a piece of code is capable of deadlocking, you cannot eliminate the possibility of deadlocking by inserting invocations of Thread.yield().
第13题:
Which statements concerning the methods notify() and notifyAll() are true?
第14题:
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()?()
第15题:
Which two can directly cause a thread to stop executing?()
第16题:
What can cause a thread to become non-runnable?()
第17题:
Which statement is true?()
第18题:
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()?
第19题:
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.
第20题:
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.
第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题:
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.
第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.