Created
May 30, 2019 20:54
-
-
Save suoko/2b3daada748c0d476a48059ca6dc0ce5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Multimap<String, String> myMultimap = ArrayListMultimap.create(); | |
// Adding some key/value | |
myMultimap.put("Fruits", "Bannana"); | |
myMultimap.put("Fruits", "Apple"); | |
myMultimap.put("Fruits", "Pear"); | |
myMultimap.put("Vegetables", "Carrot"); | |
// Getting values | |
Collection<string> fruits = myMultimap.get("Fruits"); | |
System.out.println(fruits); // [Bannana, Apple, Pear] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment