Thread
Runnable
Object
Event
Synchronize
第1题:
fooandbararepublicreferencesavailabletomanyotherthreads.fooreferstoaThreadandbarisanObject.Thethreadfooiscurrentlyexecutingbar.wait().Fromanotherthread,whichstatementisthemostreliablewaytoensuethatfoowillstopexecutingwait()?
A.foo.notify();
B.bar.notify();
C.foo.notifyAll();
D.Thread.notify();
E.bar.notiFYAll();
F.Object.notify();
第2题:
实现线程交互的wait()和notify()方法在______类中定义。
第3题:
线程交互中不提倡使用的方法是( )。
A.wait()
B.notify()
C.stop()
D.notifyall()
第4题:
在JAVA中,调用一个对象的wait()方法后,()
第5题:
Which two CANNOT directly cause a thread to stop executing?()
第6题:
wait()、notify()和notifyAll()方法是在哪个类中定义的()。
第7题:
What can cause a thread to become non-runnable?()
第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.
第9题:
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.
第10题:
如果该对象的notify()方法已经被调用,则不会产生任何效果
在另外一个对象调用它的notify()或 notifyAll()方法之前该对象一直被挂起
将抛出一个异常
该对象的wait()方法与其他对象自动同步
第11题:
foo.notify();
bar.notify();
foo.notifyAll();
Thread.notify();
bar.notiFYAll();
Object.notify();
第12题:
wait()方法的调用者是同步锁对象
wait()方法使线程进入等待状态
调用同一锁对象的notify()或notifyAll()方法可以唤醒调用wait()方法等待的线程
调用wait()方法的线程会释放同步锁对象
第13题:
Given:fooandbararepublicreferencesavailabletomanyotherthreads.fooreferstoaThreadandbarisanObject.Thethreadfooiscurrentlyexecutingbar.wait().Fromanotherthread,whatprovidesthemostreliablewaytoensurethatfoowillstopexecutingwait()?
A.foo.notify();
B.bar.notify();
C.foo.notifyAll();
D.Thread.notify();
E.bar.notifyAll();
第14题:
下列说法中错误的一项是
A.当线程需要在synchronized块中等待共享数据状态改变时,则需要调用wait()方法
B.当线程需要在synchronized块中等待共享数据状态改变时,则需要调用notify()方法
C.线程在synchronized块中执行完操作后,调用notify()方法通知正在等待的线程重新占有锁
D.wait()和notify()可以实现线程的同步操作
第15题:
java中下面哪些是Object类的方法()。
第16题:
void waitForSignal() { Object obj = new Object(); synchronized (Thread.currentThread()) { obj.wait(); obj.notify(); } } Which is true?()
第17题:
对于wait()方法,下面说法正确的是?()
第18题:
Which statements concerning the methods notify() and notifyAll() are true?
第19题:
Thread
Runnable
Object
Event
Synchronize
第20题:
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.
第21题:
foo.notify();
bar.notify();
foo.notifyAll();
Thread.notify();
bar.notifyAll();
Object.notify();
第22题:
foo.notify();
bar.notify();
foo.notifyAll();
Thread.notify();
bar.notifyAll();
第23题:
Object类提供了wait,notify,notifyAll等函数用于线程间同步
Object类提供了clone,compare,delete,add,insert等函数用于对对象进行操作
Object类是所有自定义类的直接或间接父类,但不是系统类的父类
Object类定义了一些每个类都应该有的基本的成员变量和成员函数
Object类是其它一切类的直接或间接父类
第24题: