+ 2

What will happen if we put a key object in a HashMap which is already there?

19th Jun 2017, 1:41 PM
Arjun Katwal
Arjun Katwal - avatar
5 Answers
+ 1
the value of the key will be replaced by new one.
19th Jun 2017, 3:22 PM
Highman
Highman - avatar
+ 1
seriously.. The best way to figure stuff like that out is experiment.
19th Jun 2017, 3:23 PM
LordHill
LordHill - avatar
0
try it
19th Jun 2017, 1:54 PM
LordHill
LordHill - avatar
0
It will be overwritten
19th Jun 2017, 2:00 PM
Louis
Louis - avatar
0
Yeah or just google it. But that applies to 90% of questions here
19th Jun 2017, 3:27 PM
Louis
Louis - avatar