I thought hashmaps couldn't have duplicate keys, but isn't that what is happening here when adding pairs with the same last name? Thanks!
Laurence
Level 10
Hi guys, quick question about duplicate keys
Under discussion
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Gellert Varga
25 May 2020, 20:23
Hi!
"I thought hashmaps couldn't have duplicate keys"
You think it well!!:)
"when adding pairs with the same last name"
- just try out!!
Will not succeed:)
Enter 10 pairs with 3 identical lastnames and print the result.
HashMap will consist of 8 items.
And the verifier will give pass!
+1