Compilation fails.
An exception is thrown.
The wait() method has no effect.
Thread X receives the lock immediately.
Object A moves the thread to the wait pool.
第1题:
Which two of statements are true?()
第2题:
Under which circumstances will a thread stop?()
第3题:
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()?()
第4题:
Which two CANNOT directly cause a thread to stop executing? ()
第5题:
You define a multiple-row subquery in the WHERE clause of an SQL query with a comparison operator "=".What happens when the main query is executed?()
第6题:
A
B
C
D
第7题:
第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题:
Call the Invoke method of the delegate.
Call the BeginInvoke and EndInvoke methods of the delegate in the calling thread.
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.
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.
第10题:
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.
第11题:
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.
第12题:
foo.notify();
bar.notify();
foo.notifyAll();
Thread.notify();
bar.notifyAll();
第13题:
Which statements concerning the methods notify() and notifyAll() are true?
第14题:
What happens when thread X executes a wait() method on object A, without owning object A’s lock?()
第15题:
What can cause a thread to become non-runnable?()
第16题:
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()?
第17题:
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.
第18题:
Compilation fails.
An exception is thrown at runtime.
The code executes and prints “running”.
The code executes and prints “runningrunning”.
The code executes and prints “runningrunningrunning”.
第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.
第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题:
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.
第22题:
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.
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.
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.
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.
第23题:
The main query executes with the first value returned by the subquery.
The main query executes with the last value returned by the subquery.
The main query executes with all the values returned by the subquery.
The main query fails because the multiple-row subquery cannot be used with the comparison operator.
You cannot define a multiple-row subquery in the WHERE clause of a SQL query.