Home / CSE MCQs / JAVA MCQs :: Discussion

Discussion :: JAVA MCQs

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

    View Answer

    Workspace

    Answer : Option D

    Explanation :

    keySet() methods is used to get a set containing all the keys used in a map. This method provides set view of the keys in the invoking map.


Be The First To Comment