Dhiral Kaniya :
I want to get values for more than one key using HashMap
, for example:
HashMap<Integer, String> map = new HashMap<Integer, String>();
map.put(1, "Hello");
map.put(2, "World");
map.put(3, "New");
map.put(4, "Old");
Now I want to combine values for 1
and 2
and create a List<String>
output. I can do this with 2 times get an operation or create one function that takes a key list and return a list of values.
But is there any in-built util function that do the same job?