Libraries exist to do this, but the simplest plain Java way is to create a Map
of List
like this:
Map<Object,ArrayList<Object>> multiMap = new HashMap<>();
More Related Contents:
- Why do we really need Comparator in Java? [closed]
- How to use class instead of interface for lambda param
- Understanding Spring @Autowired usage
- What is the native keyword in Java for?
- How to free memory in Java?
- Java 8 Date and Time: parse ISO 8601 string without colon in offset [duplicate]
- java regular expression to extract content within square brackets
- What code folding plugins work on Eclipse 3.6?
- How do I use audio sample data from Java Sound?
- #define in Java
- ImprovedNamingStrategy no longer working in Hibernate 5
- How to call a method on specific time in java?
- Java 8 chained method reference?
- Whats the best way to recursively reverse a string in Java?
- Where is the Java SDK folder in my computer? Ubuntu 12.04
- Java Unicode encoding
- How to deploy a JAX-RS application?
- The ultimate Java version table (J2EE, Java EE, Servlet, JSP, JSTL)
- How to speed up Java VM (JVM) startup time?
- Class method and variable with same name, compile error in C++ not in Java?
- Use a dependency’s resources?
- Doing an “IN” query with Hibernate
- How do I get the intersection between two arrays as a new array?
- Oracle Java code conventions
- Character display/search for Unicode characters
- Most elegant way to join a Map to a String in Java 8
- Does a breakpoint halt all threads?
- Java. Implicit super constructor Employee() is undefined. Must explicitly invoke another constructor [duplicate]
- Is there a difference between String concat and the + operator in Java? [duplicate]
- Java String literal pool and string object