java - Unsupported add/addAll operations for Map<K,V>.keySet() -


regarding map<k,v> interface:

why keyset() return set supports remove operation doesn't support add() , addall() operations?

the set returned keyset backed map, changes map reflected in set, , vice-versa. means calling remove on set removes matching entry map.

it make no sense call add or addall on set, since can't add key[s] without corresponding value[s] map.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -