I have a hash map with 5 elements in it. I would like to display the mapped value and the key value of an element based on the (element id) user input. For instance, if the user enters 2, I would like to display the map value and the key for the element at #2 in the hash map.
How do I go about doing this?
Thanks,
Praveen
This is a question without an answer; regardless of language or platform (which you’ve neglected to mention,) a hashmap, by definition, is an unordered container. There is no element #2. The elements in a hashmap are not kept in any defined order.