1.

Which of these methods can be used to obtain set of all keys in a map?(a) getAll()(b) getKeys()(c) keyall()(d) keySet()The question was posed to me in my homework.This intriguing question originated from Java.util in portion java.util – The Collections Framework of Java

Answer»

The CORRECT option is (d) KEYSET()

To explain I would say: 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.



Discussion

No Comment Found

Related InterviewSolutions