Answer: keySet view is method in HashMap class.
This method returns Set view of all keys that is contained in map. Below is important point of KeySet:
Any chages in the map will be reflected to the Set and vice-versa.
If map is getting modified during iteration over the set are in progress (except using iterator’s own remove operation) then results of iteration are undefined.
Note: Set supports element removal operation through which it removes corresponding mapping from the map, via Set.remove, Iterator.remove, removeAll, retainAll, and clear operations. It does not supports add and addAll methods.