Retrieve all the keys contained within a map.
import public
|
The keySet() method returns a set comprising all the keys present in the map.
Note: The set returned is a view of the map, implying that modifications made to the set will also affect the map.
public |
K represents the data type of the map’s keys.
Returns: |
A set that encompasses all the keys within the map. |