可学答题网 > 问答 > SCJP程序员认证考试题库
目录: 标题| 题干| 答案| 搜索| 相关
问题

void waitForSignal() {&ensp


void waitForSignal() {  Object obj = new Object();  synchronized (Thread.currentThread()) {  obj.wait();  obj.notify();  }  }  Which is true?() 

  • A This code may throw an InterruptedException.
  • B This code may throw an IllegalStateException.
  • C This code may throw a TimeoutException after ten minutes.
  • D This code will not compile unless “obj.wait()” is replaced with “((Thread) obj).wait()”.
  • E Reversing the order of obj.wait() and obj.notify() may cause this method to complete normally.
  • F A call to notify() or notifyAll() from another thread may cause this method to complete normally.
参考答案
参考解析:
分类:SCJP程序员认证考试题库
相关推荐

1、11. public static void

11. public static void main(String[] args) { 12. Integer i = uew Integer(1) + new Inte...

2、11. public void addStr

11. public void addStrings(List list) { 12. list.add(foo); 13. list.add(bar); 14. } What mus...

3、11. public void someMe

11. public void someMethod(Object value) { 12. // check for null value .... 20. System.out.pr...

4、11. public static void

11. public static void test(String str) { 12. if(str == null  str.lellgth() == 0) {&...

5、表达式10>5&&6%3的值是()

表达式10>5&&6%3的值是()A-1B非零值C0D1

6、11. public void genNum

11. public void genNumbers() { 12. ArrayList numbers = new ArrayList(); 13. for (int i=0...