java - why does return type of values in iterator not a set? -


in map interface

  collection<v> values(); 

why function not return set entryset() , keyset()?

thanks.

in map, keys unique can map same value.

put way:

  • the values not unique , therefore cannot stored in set without losing duplicates.

  • the keys , entires, on other hand, unique.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -