I found the following statement:
Map is an object that stores
key/volume pairs. Given a key, you can
find its value. Keys must be unique,
but values may be duplicated.
For example I have just one key/value pair (3,4). And now I put a new pair (3,5). It will remove the old pair. Right? But if I put (2,4) instead of (3,4) I will add a new pair of key/value to the HashMap. Right?
Yes, the first number in the parentheses is the Key, you can think of it as the address. The second is the Value. The Key is unique, just like your home’s address, but the Value can be anything.