Home / CSE MCQs / JAVA MCQs :: Discussion

Discussion :: JAVA MCQs

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

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    Maps revolve around two basic operations “ get() and put(). to put a value into a map, use put(), specifying the key and the value. To obtain a value, call get() , passing the key as an argument. The value is returned


Be The First To Comment