Please read comments before You downmark!
I want convert content of HashMap to String as converting ArrayList to String using Arrays.toString(arrayList).
Is it possible ? There is easy way to do this?
Do I must have to iteration and appending it using Iterator ? As example:
HashMap<String, ArrayList<MyObject>> objectMap = new HashMap<String, ArrayList<>>();
//.... put many items to objectMap
Iterator it = objectMap.entrySet().iterator();
while(it.hasNext()){
Map.Entry pairs = (Map.Entry) it.next();
System.out.println(pairs.getKey() + " = " + pairs.getValue());
}
I think that it is different because of pair <String, ArrayList> not <String, Integer>