Is it possible for us to implement a HashMap with one key and two values. Just as HashMap?
Please do help me, also by telling (if there is no way) any other way to
If you use Spring Framework. There is: org.springframework.util.MultiValueMap.
org.springframework.util.MultiValueMap
To create unmodifiable multi value map:
Map> map = ... MultiValueMap multiValueMap = CollectionUtils.toMultiValueMap(map);
Or use org.springframework.util.LinkedMultiValueMap
org.springframework.util.LinkedMultiValueMap