It is just replacing the value mapped by key 'word'. It is not creating any new entry in map.
After first call of put method a mapping is created.
And for any subsequent call to put method if the map contained a mapping for key, the old value is replaced.
SCJP 5,SCWCD 5, RHCT
Em Aiy
Ranch Hand
Joined: May 11, 2006
Posts: 225
posted
0
Anuj Prashar wrote:It is just replacing the value mapped by key 'word'. It is not creating any new entry in map.
but it should give error "duplicate entry" (word). isn't it so ?