Collections


  1. Which of these methods can be used to obtain set of all keys in a map?











  1. View Hint View Answer Discuss in Forum

    NA

    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.


  1. Which of these classes provide implementation of map interface?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    AbstractMap, WeakHashMap, HashMap and TreeMap provide implementation of map interface.



  1. Which of these method is used to remove all keys/values pair from the invoking map?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    remove()


  1. Which of these method Map class is used to obtain an element in the map having specified key?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    get()



  1. Which of these object stores association between keys and values?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Map