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

CSE MCQs :: JAVA MCQs

  1. Which of these methods can be used to delete the last element in a LinkedList object?
  2. A.
    remove()
    B.
    delete()
    C.
    removeLast()
    D.
    deleteLast()

  3. Which of these method is used to change an element in a LinkedList Object?
  4. A.
    change()
    B.
    set()
    C.
    redo()
    D.
    add()

  5. Which of these object stores association between keys and values?
  6. A.
    Hash table
    B.
    Map
    C.
    Array
    D.
    String

  7. Which of these classes provide implementation of map interface?
  8. A.
    ArrayList
    B.
    HashMap
    C.
    LinkedList
    D.
    DynamicList

  9. Which of these method is used to remove all keys/values pair from the invoking map?
  10. A.
    delete()
    B.
    remove()
    C.
    clear()
    D.
    removeAll()

  11. Which of these method Map class is used to obtain an element in the map having specified key?
  12. A.
    search()
    B.
    get()
    C.
    set()
    D.
    look()

  13. Which of these methods can be used to obtain set of all keys in a map?
  14. A.
    getAll()
    B.
    getKeys()
    C.
    keyall()
    D.
    keySet()

  15. Which of these method is used add an element and corresponding key to a map?
  16. A.
    put()
    B.
    set()
    C.
    redo()
    D.
    add()

  17. Which of these standard collection classes implements all the standard functions on list data structure?
  18. A.
    Array
    B.
    LinkedList
    C.
    HashSet
    D.
    AbstractSet

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