java - What is difference between HashMap and HashMultimap -


i see many examples multimap did not understand why google gauva different?

multimap<integer, set<string>> option4 = hashmultimap.create(); // gauva  map<integer, set<string>> opt = new hashmap<integer, set<string>>(); //core java 

is both above behave same holding data or different?

a multimap<a, b> associates key of type value of type collection<b> (hence name multimap)

a map<a, b> associates key of type value of type b.

so, multimap<integer, set<string>> can viewed map<integer, collection<set<string>>. should obvious reading the api documentation.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -