Home / CSE MCQs / JAVA MCQs :: java.util Package

CSE MCQs :: JAVA MCQs

  1. Which of these standard collection classes implements a dynamic array?
  2. A.
    AbstractList
    B.
    LinkedList
    C.
    ArrayList
    D.
    AbstractSet

  3. Which of these class can generate an array which can increase and decrease in size automatically?
  4. A.
    ArrayList()
    B.
    DynamicList()
    C.
    LinkedList()
    D.
    DynamicList()

  5. Which of these method can be used to increase the capacity of ArrayList object manually?
  6. A.
    Capacity()
    B.
    increaseCapacity()
    C.
    increasecapacity()
    D.
    ensureCapacity()

  7. Which of these method of ArrayList class is used to obtain present size of an object?
  8. A.
    size()
    B.
    length()
    C.
    index()
    D.
    capacity()

  9. Which of these methods can be used to obtain a static array from an ArrayList object?
  10. A.
    Array()
    B.
    covertArray()
    C.
    toArray()
    D.
    covertoArray()

  11. Which of these method is used to reduce the capacity of an ArrayList object?
  12. A.
    trim()
    B.
    trimSize()
    C.
    trimTosize()
    D.
    trimToSize()

  13. Which of these standard collection classes implements a linked list data structure?
  14. A.
    AbstractList
    B.
    LinkedList
    C.
    HashSet
    D.
    AbstractSet

  15. Which of these classes implements Set interface?
  16. A.
    ArrayList
    B.
    HashSet
    C.
    LinkedList
    D.
    DynamicList

  17. Which of these method is used to add an element to the start of a LinkedList object?
  18. A.
    add()
    B.
    first()
    C.
    AddFirst()
    D.
    addFirst()

  19. Which of these method of HashSet class is used to add elements to its object?
  20. A.
    add()
    B.
    Add()
    C.
    addFirst()
    D.
    insert()