Home » JAVA Programming » Collections » Question
  1. Which of these methods can be used to obtain set of all keys in a map?
    1. keyall()
    2. keySet()
    3. getAll()
    4. getKeys()
    5. None of these
Correct Option: B

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.



Your comments will be displayed only after manual approval.