搜题
用户您好, 请在下方输入框内搜索其它题目:
搜题
题目内容 (请给出正确答案)
提问人:网友 发布时间:
【单项选择题】

void&ensp;waitForSignal()&ensp;{&ensp;<br /> Object&ensp;obj&ensp;=&ensp;new&ensp;Object();&ensp;<br /> synchronized&ensp;(Thread.currentThread())&ensp;{&ensp;<br /> obj.wait();&ensp;<br /> obj.notify();&ensp;<br /> }&ensp;<br /> }&ensp;<br /> Which&ensp;is&ensp;true?()&ensp;<p> void&ensp;waitForSignal()&ensp;{&ensp;<br /> Object&ensp;obj&ensp;=&ensp;new&ensp;Object();&ensp;<br /> synchronized&ensp;(Thread.currentThread())&ensp;{&ensp;<br /> obj.wait();&ensp;<br /> obj.notify();&ensp;<br /> }&ensp;<br /> }&ensp;<br /> Which&ensp;is&ensp;true?()&ensp;</p>

A、A. This code may throw an InterruptedException.

B、B. This code may throw an IllegalStateException.

C、C. This code may throw a TimeoutException after ten minutes.

D、D. This code will not compile unless “obj.wait()” is replaced with “((Thread) obj).wait()”.

E、E. Reversing the order of obj.wait() and obj.notify() may cause this method to complete normally.

F、F. A call to notify() or notifyAll() from another thread may cause this method to complete normally.

更多“void&ensp;waitForSignal()&ensp;{&ensp;<br /> Object&ensp;obj&ensp;=&ensp;new&ensp;Object();&ensp;<br /> synchronized&ensp;(Thread.currentThread())&ensp;{&ensp;<br /> obj.wait();&ensp;<br /> obj.notify();&ensp;<br /> }&ensp;<br /> }&ensp;<br /> Which&ensp;is&ensp;true?()&ensp;<p> void&ensp;waitForSignal()&ensp;{&ensp;<br /> Object&ensp;obj&ensp;=&ensp;new&ensp;Object();&ensp;<br /> synchronized&ensp;(Thread.currentThread())&ensp;{&ensp;<br /> obj.wait();&ensp;<br /> obj.notify();&ensp;<br /> }&ensp;<br /> }&ensp;<br /> Which&ensp;is&ensp;true?()&ensp;</p>”相关的问题
第1题

A、public&ensp;void&ensp;m1(){}  B、protected&ensp;void&ensp;m1(){}  C、private&ensp;void&ensp;m1(){}  D、void&ensp;m2(){}  E、pubic&ensp;void&ensp;m2(){}  F、protected&ensp;void&ensp;m2(){}  H、private&ensp;void&ensp;m2(){}  

点击查看答案
第2题

A、public&ensp;void&ensp;m1()&ensp;{&ensp;}  B、protected&ensp;void&ensp;m1()&ensp;{&ensp;}  C、private&ensp;void&ensp;m1()&ensp;{&ensp;}  D、void&ensp;m2()&ensp;{&ensp;}  E、public&ensp;void&ensp;m2()&ensp;{&ensp;}  F、protected&ensp;void&ensp;m2()&ensp;{&ensp;}  

点击查看答案
第3题

A、private&ensp;void&ensp;run()  B、public&ensp;void&ensp;run()  C、public&ensp;void&ensp;start()  D、public&ensp;void&ensp;begin()  

点击查看答案
第4题

A、public&ensp;void&ensp;aMethod();  B、void&ensp;aMethod();  C、protected&ensp;void&ensp;aMethod();  D、private&ensp;void&ensp;aMethod();  

点击查看答案
第5题

A、A.&ensp;Final&ensp;void&ensp;methoda(){}  B、B.&ensp;Void&ensp;final&ensp;methoda(){}  C、C.&ensp;Static&ensp;void&ensp;methoda(){}  D、D.&ensp;Static&ensp;final&ensp;void&ensp;methoda(){}  E、E.&ensp;Final&ensp;abstract&ensp;void&ensp;methoda(){}  

点击查看答案
第6题

A、A.&ensp;Final&ensp;void&ensp;methoda()&ensp;{}  B、B.&ensp;Void&ensp;final&ensp;methoda()&ensp;{}  C、C.&ensp;Static&ensp;void&ensp;methoda()&ensp;{}  D、D.&ensp;Static&ensp;final&ensp;void&ensp;methoda()&ensp;{}  E、E.&ensp;Final&ensp;abstract&ensp;void&ensp;methoda()&ensp;{}  

点击查看答案
第7题

A、A.&ensp;void&ensp;run()  B、B.&ensp;public&ensp;void&ensp;run()  C、C.&ensp;public&ensp;void&ensp;start()  D、D.&ensp;void&ensp;run(int&ensp;priority)  E、E.&ensp;public&ensp;void&ensp;run(int&ensp;priority)  F、F.&ensp;public&ensp;void&ensp;start(int&ensp;priority)  

点击查看答案
第9题

A、A.&ensp;public&ensp;static&ensp;void&ensp;main(String[]&ensp;args){}  B、B.&ensp;public&ensp;static&ensp;void&ensp;main(){}  C、C.&ensp;public&ensp;static&ensp;void&ensp;main(String&ensp;args[]){}  D、D.&ensp;public&ensp;void&ensp;static&ensp;main(String[]&ensp;args){}  

点击查看答案
第10题

A、&ensp;protected&ensp;void&ensp;change(int&ensp;x){}  B、&ensp;public&ensp;void&ensp;change(int&ensp;x,&ensp;int&ensp;y){}  C、&ensp;public&ensp;void&ensp;change(String&ensp;s){}  D、&ensp;public&ensp;void&ensp;change(int&ensp;x){}  

点击查看答案
客服
TOP

请使用微信扫码支付

订单号:
遇到问题请联系在线客服