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

CSE MCQs :: JAVA MCQs

  1. Which of these class object can be used to form a dynamic array?
  2. A.
    ArrayList
    B.
    Map
    C.
    Vector
    D.
    Both a & b

  3. Which of these are legacy classes?
  4. A.
    Stack
    B.
    Hashtable
    C.
    Vector
    D.
    All of the mentioned

  5. Which of these is the interface of legacy?
  6. A.
    Map
    B.
    Enumeration
    C.
    HashMap
    D.
    Hashtable

  7. What is the name of data member of class Vector which is used to store number of elements in the vector?
  8. A.
    length
    B.
    elements
    C.
    elementCount
    D.
    capacity

  9. Which of these methods is used to add elements in vector at specific location?
  10. A.
    add()
    B.
    set()
    C.
    AddElement()
    D.
    addElement()

  11. Which of these class object uses key to store value?
  12. A.
    Dictionary
    B.
    Map
    C.
    Hashtable
    D.
    All if the mentioned

  13. Which of these method is used to insert value and its key?
  14. A.
    put()
    B.
    set()
    C.
    insertElement()
    D.
    addElement()

  15. Which of these is the interface of legacy is implemented by Hashtable and Dictionary classes?
  16. A.
    Map
    B.
    Enumeration
    C.
    HashMap
    D.
    Hashtable

  17. Which of these is a class which uses String as a key to store the value in object?
  18. A.
    Array
    B.
    ArrayList
    C.
    Dictionary
    D.
    Properties

  19. Which of these methods is used to retrieve the elements in properties object at specific location?
  20. A.
    get()
    B.
    Elementat()
    C.
    ElementAt()
    D.
    getProperty()