易搜题 > 资格证大类 > 计算机编程 > 问题详情
问题详情

Which statements concerning the methods notify() and notifyAll() are true?  

A

Instances of class Thread have a method called notify().

B

A call to the method notify() will wake the thread that currently owns the monitor of the object.

C

The method notify() is synchronized.

D

The method notifyAll() is defined in class Thread.

E

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.

未找到的试题在搜索页框底部可快速提交,在会员中心"提交的题"查看可解决状态。 收藏该题
查看答案

相关问题推荐

  • 34. HashMap props = new HashMap();  35. props.put(”key45”, “some value”);  36. props.put(”key12”, “some other value”);  37. props.put(”key39”, “yet another value”);  38. Set s = props.keySet();  39. // insert code here  What, inserted at line 39, will sort the keys in the props HashMap?() 

    A、 Arrays.sort(s);

    B、 s = new TreeSet(s);

    C、 Collections.sort(s);

    D、 s = new SortedSet(s);

  • Given a vaid DateFormat object named df, and What updates d’s value with the date represented by ds?()

    A、 18.d=df.parse(ds);

    B、 18.d=df.getDate(ds);

    C、 18.try{19.d=df.parse(ds);20. }catch(ParseException e){ }

    D、 18.try{19.d=df.getDate(ds);20. }catch(ParseException e){ }

  • A Button is positioned in a Frame. Only height of the Button is affected by the Frame while the width is not. Which layout manager should be used?()    

    A、 FlowLayout

    B、 CardLayout

    C、 North and South of BorderLayout

    D、 East and West of BorderLayout

    E、 GridLayout

  • interface Beta {}  class Alpha implements Beta {  String testIt() {  return “Tested”;  }  }  public class Main1 {  static Beta getIt() {  return new Alpha();  }  public static void main( String[] args ) {  Beta b = getIt();  System.out.println( b.testIt() );  }  }  What is the result?()  

    A、 Tested

    B、 Compilation fails.

    C、 The code runs with no output.

    D、 An exception is thrown at runtime.

  • ClassOne.java  1. package com.abc.pkg1;  2. public class ClassOne {  3. private char var = ‘a’;   4. char getVar()  {return var;}  5. }  ClassTest.java    1. package com.abc.pkg2;  2. import com.abc.pkg1.ClassOne;  3. public class ClassTest extends ClassOne {  4.   public static void main(String[]args)  {  5.     char a = new ClassOne().getVar();  6.     char b = new ClassTest().getVar();   7.   }  8. }      What is the result?()  

    A、 Compilation will fail.

    B、 Compilation succeeds and no exceptions are thrown.

    C、 Compilation succeeds but an exception is thrown at line 5 in ClassTest.java.

    D、 Compilation succeeds but an exception is thrown at line 6 in ClassTest.java.

联系客服 会员中心
TOP