Get key from a HashMap using the value [duplicate]
The put method in HashMap is defined like this: Object put(Object key, Object value) key is the first parameter, so in your put, “one” is the key. You can’t easily look up by value in a HashMap, if you really want to do that, it would be a linear search done by calling entrySet(), like … Read more