Hi I have a list of people with their ages, I need to find those who are more than 30 years old, is there any possibility to search in a hashmap ? (please note that I may need
Good question... unfortunately, a Map needs a very specific key. Your solution above is the only real way to do it.
Alternatively you could maintain two lists, and store those that older than 30 to the 2nd list.