单选题Which statement is true for the class java.util.HashSet? ()AThe elements in the collection are ordered.BThe collection is guaranteed to be immutable.CThe elements in the collection are guaranteed to be unique.DThe elements in the collection are accesse

题目
单选题
Which statement is true for the class java.util.HashSet? ()
A

 The elements in the collection are ordered.

B

 The collection is guaranteed to be immutable.

C

 The elements in the collection are guaranteed to be unique.

D

 The elements in the collection are accessed using a unique key.

E

 The elements in the collections are guaranteed to be synchronized.


相似考题
更多“单选题Which statement is true for the class java.util.HashSet? ()A  The elements in the collection are ordered.B  The collection is guaranteed to be immutable.C  The elements in the collection are guaranteed to be unique.D  The elements in the collection are”相关问题
  • 第1题:

    Which statement is true for the class java.util.ArrayList?()  

    • A、 The elements in the collection are ordered.
    • B、 The collection is guaranteed to be immutable.
    • C、 The elements in the collection are guaranteed to be unique.
    • D、 The elements in the collection are accessed using a unique key.
    • E、 The elements in the collections are guaranteed to be synchronized.

    正确答案:A

  • 第2题:

    Which statements about the garbage collection are true?() 

    • A、 The program developer must create a thread to be responsible for free the memory.
    • B、 The garbage collection will check for and free memory no longer needed.
    • C、 The garbage collection allow the program developer to explicity and immediately free the memory.
    • D、 The garbage collection can free the memory used java object at expect time.

    正确答案:B

  • 第3题:

    You need to store elements in a collection that guarantees that no duplicates are stored. Which two interfaces provide that capability?()   

    • A、 Java.util.Map
    • B、 Java.util.Set
    • C、 Java.util.List
    • D、 Java.util.StoredSet
    • E、 Java.util.StoredMap
    • F、 Java.util.Collection

    正确答案:B,D

  • 第4题:

    11. class Snoochy {  12. Boochybooch;  13. public Snoochy() { booch = new Boochy(this); }  14. }  15.  16. class Boochy {  17. Snoochy snooch;  18. public Boochy(Snoochy s) { snooch = s; }  19. }  And the statements:  21. public static void main(String[] args) {  22. Snoochy snoog = new Snoochy();  23. snoog = null;  24. // more code here  25. }  Which statement is true about the objects referenced by snoog, snooch, and booch immediately after line 23 executes?() 

    • A、 None of these objects are eligible for garbage collection.
    • B、 Only the object referenced by booch is eligible for garbage collection.
    • C、 Only the object referenced by snoog is eligible for garbage collection.
    • D、 Only the object referenced by snooch is eligible for garbage collection.
    • E、 The objects referenced by snooch and booch are eligible for garbage collection.

    正确答案:E

  • 第5题:

    Which two statements are true about the hashCode method?()

    • A、The hashCode method for a given class can be used to test for object equality and object inequality for that class.
    • B、The hashCode method is used by the java.util.SortedSet collection class to order the elements within that set.
    • C、The hashCode method for a given class can be used to test for object inequality, but NOT objecte quality, for that class.
    • D、The only important characteristic of the values returned by a hashCode method is that the distribution of values must follow a Gaussian distribution.
    • E、The hashCode method is used by the java.util.HashSet collection class to group the elements within that set into hash buckets for swift retrieval.

    正确答案:C,E

  • 第6题:

    单选题
    1. import java.util.*;  2. public class TestSet {  3. enum Example { ONE, TWO, THREE }  4. public static void main(String[] args) {  5. Collection coll = new ArrayList();  6. coll.add(Example.THREE);  7. coll.add(Example.THREE);  8. coll.add(Example.THREE);  9. coll.add(Example.TWO);  10. coll.add(Example.TWO);  11. coll.add(Example.ONE);  12. Set set = new HashSet(coll);  13. }  14. }  Which statement is true about the set variable on line 12?()
    A

     The set variable contains all six elements from the coll collection, and the order is guaranteed to be preserved.

    B

     The set variable contains only three elements from the coll collection, and the order is guaranteed to be preserved.

    C

     The set variable contains all six elements from the coil collection, but the order is NOT guaranteed to be preserved.

    D

     The set variable contains only three elements from the coil collection, but the order is NOT guaranteed to be preserved.


    正确答案: B
    解析: 暂无解析

  • 第7题:

    多选题
    You need to store elements in a collection that guarantees that no duplicates are stored. Which two interfaces provide that capability?()
    A

    Java.util.Map

    B

    Java.util.Set

    C

    Java.util.List

    D

    Java.util.StoredSet

    E

    Java.util.StoredMap

    F

    Java.util.Collection


    正确答案: D,C
    解析: 暂无解析

  • 第8题:

    单选题
    Which statement is true for the class java.util.HashSet? ()
    A

     The elements in the collection are ordered.

    B

     The collection is guaranteed to be immutable.

    C

     The elements in the collection are guaranteed to be unique.

    D

     The elements in the collection are accessed using a unique key.

    E

     The elements in the collections are guaranteed to be synchronized.


    正确答案: A
    解析: 暂无解析

  • 第9题:

    多选题
    Which of these statements concerning the collection interfaces are true?()
    A

    Set extends Collection.

    B

    All methods defined in Set are also defined in Collection.

    C

    List extends Collection.

    D

    All methods defined in List are also defined in Collection.

    E

    Map extends Collection.


    正确答案: A,B,C
    解析: 暂无解析

  • 第10题:

    单选题
    You work as an application developer at Certkiller .com. Certkiller .com has been contracted to develop an application for the local bank.You have been given the responsibility of creating this application and need to store each transaction record, which is identified using a complex transaction identifier,in memory. The bank informs you that the total amount of transaction records could reach 200 per day. To achieve this, you decide to utilize one of the existing collection classes in the .NET 2.0 class library. You need to ensure that you the collection class you select is the most efficient one for storing transaction records.What should you do?()
    A

     Select the ListDictionary collection class.

    B

     Select the HashTable collection class.

    C

     Select the Queue collection class.

    D

     Select the StringCollection collection class.


    正确答案: D
    解析: 暂无解析

  • 第11题:

    多选题
    Which two statements are true about the hashCode method?()
    A

    The hashCode method for a given class can be used to test for object equality and object inequality for that class.

    B

    The hashCode method is used by the java.util.SortedSet collection class to order the elements within that set.

    C

    The hashCode method for a given class can be used to test for object inequality, but NOT objecte quality, for that class.

    D

    The only important characteristic of the values returned by a hashCode method is that the distribution of values must follow a Gaussian distribution.

    E

    The hashCode method is used by the java.util.HashSet collection class to group the elements within that set into hash buckets for swift retrieval.


    正确答案: E,D
    解析: 暂无解析

  • 第12题:

    单选题
    You need to store elements in a collection that guarantees that no duplicates are stored and all elements can be accessed in natural order. Which interface provides that capability?()
    A

    Java.util.Map.

    B

    Java.util.Set.

    C

    Java.util.List.

    D

    Java.util.StoredSet.

    E

    Java.util.StoredMap.

    F

    Java.util.Collection.


    正确答案: F
    解析: 暂无解析

  • 第13题:

    Which statement is true for the class java.util.HashSet?()  

    • A、 The elements in the collection are ordered.
    • B、 The collection is guaranteed to be immutable.
    • C、 The elements in the collection are guaranteed to be unique.
    • D、 The elements in the collection are accessed using a unique key.
    • E、 The elements in the collections are guaranteed to be synchronized.

    正确答案:C

  • 第14题:

    1. import java.util.*;  2. public class TestSet {  3. enum Example { ONE, TWO, THREE }  4. public static void main(String[] args) {  5. Collection coll = new ArrayList();  6. coll.add(Example.THREE);  7. coll.add(Example.THREE);  8. coll.add(Example.THREE);  9. coll.add(Example.TWO);  10. coll.add(Example.TWO);  11. coll.add(Example.ONE);  12. Set set = new HashSet(coll);  13. }  14. }  Which statement is true about the set variable on line 12?() 

    • A、 The set variable contains all six elements from the coll collection, and the order is guaranteed to be preserved.
    • B、 The set variable contains only three elements from the coll collection, and the order is guaranteed to be preserved.
    • C、 The set variable contains all six elements from the coil collection, but the order is NOT guaranteed to be preserved.
    • D、 The set variable contains only three elements from the coil collection, but the order is NOT guaranteed to be preserved.

    正确答案:D

  • 第15题:

    Which of these statements concerning the collection interfaces are true?()  

    • A、Set extends Collection.
    • B、All methods defined in Set are also defined in Collection.
    • C、List extends Collection.
    • D、All methods defined in List are also defined in Collection.
    • E、Map extends Collection.

    正确答案:A,B,C

  • 第16题:

    class A {  }  class Alpha {  private A myA = new A();  void dolt( A a ) {  a = null;  }  void tryIt() {  dolt( myA );  }  }  Which two statements are correct?()  

    • A、 There are no instanced of A that will become eligible for garbage collection.
    • B、 Explicitly setting myA to null marks that instance to be eligible for garbage collection.
    • C、 Any call on tryIt() causes the private instance of A to be marked for garbage collection.
    • D、 Private instances of A become eligible for garbage collection when instances of Alpha become eligible for garbage collection.

    正确答案:B,D

  • 第17题:

    You work as an application developer at Certkiller .com. Certkiller .com has been contracted to develop an application for the local bank.You have been given the responsibility of creating this application and need to store each transaction record, which is identified using a complex transaction identifier,in memory. The bank informs you that the total amount of transaction records could reach 200 per day. To achieve this, you decide to utilize one of the existing collection classes in the .NET 2.0 class library. You need to ensure that you the collection class you select is the most efficient one for storing transaction records.What should you do?()

    • A、 Select the ListDictionary collection class.
    • B、 Select the HashTable collection class.
    • C、 Select the Queue collection class.
    • D、 Select the StringCollection collection class.

    正确答案:B

  • 第18题:

    单选题
    11.class Snoochy{ 12.Boochybooch; 13.public Snoochy(){booch=newBoochy(this);} 14.} 15. 16.class Boochy{ 17.Snoochy snooch; 18.public Boochy(Snoochys){snooch=s;} 19.} And the statements: 21.public static void main(String[]args){ 22.Snoochy snoog=new Snoochy(); 23.snoog=null; 24.//more code here 25.} Which statement is true about the objects referenced by snoog,snooch,and booch immediately after line 23 executes?()
    A

    None of these objects are eligible for garbage collection.

    B

    Only the object referenced by booch is eligible for garbage collection.

    C

    Only the object referenced by snoog is eligible for garbage collection.

    D

    Only the object referenced by snooch is eligible for garbage collection.

    E

    The objects referenced by snooch and booch are eligible for garbage collection.


    正确答案: C
    解析: 暂无解析

  • 第19题:

    单选题
    You work as an application developer at Certkiller .com. Certkiller .com has been hired by a small local private school to develop a class library that will be used in an application named ManageAttendance for the purpose of managing student records.You are responsible for developing this class library. Certkiller .com has instructed you to create a collection in the application to store learners’ results. The school has informed you that they currently only have seven learners, but that this value will triple in the following year. Due to the limited resources, you need to ensure that the collection you create consumes a minimum amount of resources. What should you use to create the collection?()
    A

     The HybridDictionary collection class.

    B

     The HashTable collection class.

    C

     The ListDictionary collection class.

    D

     The StringCollection collection class.


    正确答案: A
    解析: 暂无解析

  • 第20题:

    多选题
    Which two statements are true about the hashCode method?()
    A

    The hashCode method for a given class can be used to test for object equality and object inequality for that class.

    B

    The hashCode method is used by the java.util.SortedSet collection class to order theelements within that set.

    C

    The hashCode method for a given class can be used to test for object inequality, but NOT object equality, for that class.

    D

    The only important characteristic of the values returned by a hashCode method is that the distribution of values must follow a Gaussian distribution.

    E

    The hashCode method is used by the java.util.HashSet collection class to group the elements within that set into hash buckets for swift retrieval.


    正确答案: B,E
    解析: 暂无解析

  • 第21题:

    单选题
    Which statements about the garbage collection are true?()
    A

     The program developer must create a thread to be responsible for free the memory.

    B

     The garbage collection will check for and free memory no longer needed.

    C

     The garbage collection allow the program developer to explicity and immediately free the memory.

    D

     The garbage collection can free the memory used java object at expect time.


    正确答案: C
    解析: Java语言将内存分配和释放的工组交给了自己,程序员不必做这些工作,它提供一个系统级的线程跟踪每个内存的分配,在JVM的空闲处理中,垃圾收集线程将检查和释放不再使用的内存(即可以被释放的内存)。垃圾收集的过程在java程序的生存期中是自动的,不需要分配和释放内存,也避免了内存泄漏。可以调用System.gc()方法建议(suggest)JVM执行垃圾收集以使得可被释放的内存能立即被使用,当此方法返回的时候,JVM已经做了最大的努力从被丢弃的对象上回收内存空间。程序员不能指定收集哪些内存,一般而言也不用关心这个问题,除非是程序的内存消耗很大,特别是有很多临时对象时可以“建议“进行垃圾收集以提高可用内存。需要指出的是调用System.gc()方法不能保证JVM立即进行垃圾收集,而只能是建议,因为垃圾收集线程的优先级很低(通常是最低的)。

  • 第22题:

    单选题
    You need to store elements in a collection that guarantees that no duplicates are stored and all elements can be accessed in natural order. Which interface provides that capability?()
    A

     Java.util.Map.

    B

     Java.util.Set.

    C

     Java.util.List.

    D

     Java.util.StoredSet.

    E

     Java.util.StoredMap.

    F

     Java.util.Collection.


    正确答案: D
    解析: 暂无解析

  • 第23题:

    单选题
    Which statement is true about XpauseTarget in Oracle JRockit JVM ? ()
    A

     This option is supported by all type of Garbage collection modes.

    B

     This option is only supported by Generational Garbage Collection mode.

    C

     This option is only supported by Mark and Sweep Garbage Collection mode.

    D

     This option is only supported by Dynamic Garbage Collection mode.


    正确答案: C
    解析: 暂无解析

  • 第24题:

    单选题
    Which statement is true for the class java.util.ArrayList?()
    A

     The elements in the collection are ordered.

    B

     The collection is guaranteed to be immutable.

    C

     The elements in the collection are guaranteed to be unique.

    D

     The elements in the collection are accessed using a unique key.

    E

     The elements in the collections are guaranteed to be synchronized.


    正确答案: C
    解析: 暂无解析