¡GoConqr estrena diseño! Cuéntanos qué te parece.

Test

Java SCJP Collection 1

sonalihande81 15 preguntas

Hacer el test

Preguntas del test (15)

  1. 1Which collection class(es) allows you to grow or shrink its size and provides indexed access to
    its elements, but whose methods are not synchronized? (Choose all that apply.)
    1. Ajava.util.HashSet
    2. Bjava.util.List
    3. Cjava.util.ArrayList
    4. Djava.util.Vector
    5. Ejava.util.PriorityQueue
    6. Fjava.util.LinkedHashSet
  2. 2Which one of the following is true about natual order and insertion order ?
    1. Ainsertion order means that the order in which the items are inserted into the collection
    2. Binsertion order is determined by seeing if the element is inserted into the collection by using the insert() or add().
    3. CNatural order is different from insertion order is that the order incase of natural is determined by observing the data in the object in context
    4. DNatural order is not same as insertion order
  3. 3Wchich implementation of Set would you choose if the you want the iterator of set would geive you objects in the order it were inserted ?
    1. ALinkedHashSet
    2. BTreeSet
    3. CHashSet
  4. 4What is the data structure that a Set uses to store its elements ?
    1. Aarray
    2. Bobject
    3. CMap
    4. DArrayList
  5. 5Set allows at most one null element ?
    1. ATrue
    2. BFalse
  6. 6If you were to use a List implementation,but not sure which one to, bacause the requirement is not yet clear. In this case which List implementation will you use ?
    1. AArrayList
    2. BVector
    3. CLinkedList
  7. 7If you were to store objects into an implementation of List which happens only once in the entire lifecycle of the product,but reading these objects inside the List implementation is quite high,then which one would you use ?
    1. AVector
    2. BLinkedList
    3. CArrayList
  8. 8Which of the following implementation will you use if you were to insert elements at any position in the collection ?
    1. AArrayList
    2. BLinkedList
    3. CVector
  9. 9The EMPTY_LIST field and teh emptyList() method does return an empty immutable List .(The same also applies to
    EMPTY_SET,EMPTY_MAP and corresponding methods emptySet,emptyMap). Which of the following is/are true ?
    1. AThere is no difference between the field and emptyList() ways to fetch an empty immutable list
    2. BThe field gives you a non type-safe empty immutable object where are the method return type-safe empty immutable object of collection
    3. CThe method to get the empty immutable collections are not static, so we need to create an object of Collections class in-order to call these methods,so fields like EMPTY_XXX are better choice if one doesn't want to create object of Collections.
    4. DThe emptyXxx() methods actually returns the EMPTY_XXX fields.
  10. 10Which of the following is true about creating an empty List, but immutable ?
    1. Afinal List immutableEmptyList=new ArrayList();
    2. BList immutableEmptyList=Collections.unmodifiableList(new List());
    3. CList immutableEmptyList=Collections.EMPTY_LIST
    4. DList immutableEmptyList=Collections.unmodifiableList(new ArrayList());

Información

Descripción
Java SCJP Collection 1
Idioma
English
Visitas
124
Valoración
Aún sin valoraciones
Valora este test
Valora este test

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?