What about the case where adding a new key replaces an existing key?
Type: Posts; User: Norm
What about the case where adding a new key replaces an existing key?
I think the number of values matches the number of keys. The keys will be unique, but it is possible for there to be duplicate values. In fact all the values could be the same so that there would...
Are you asking for how many (a count) values there are in a HashMap?
There is one value for each key.
So if you know the number of keys, there will be that number of values.
Sorry, I still don't understand what you mean by "size". Can you give some examples?
For example:
"adf" has a length of 3
{1, 2, 3, 4} has a length of 4
What is the "size" of a value?
Should the value returned by the put() method be used?