I would like to store multiple values for a single key and must be able to retrieve the specific value.
Is there any data structure in Java which have this kind of functionality? If so, please let me know.
I would like to store multiple values for a single key and must be able to retrieve the specific value.
Is there any data structure in Java which have this kind of functionality? If so, please let me know.
You may use Map<key,List<T>>
HashMap<String,ArrayList<String>> map;
There is no support in JDK. What you want is a Multimap
and guava library provides it.