-1

I have the following HashMap:

Map<String,List<Objects>> abc = new HashMap<String,List<Objects>>() 

How can I iterate through the objects, to access the properties of the object?

Steve
  • 1,553
  • 2
  • 20
  • 29
user648244
  • 1,240
  • 7
  • 26
  • 41
  • 1
    Note that possible duplicates and related question appear when writing the question. – Luiggi Mendoza Apr 29 '14 at 17:53
  • Iterate over `key-value` entries to get `value` which would be list of your objects and iterate over each of this lists. I assume you know how to iterate over list. To know how to iterate over `key-value` entries check link provided by Luiggi. – Pshemo Apr 29 '14 at 17:55

1 Answers1

0
for(Entry<String, List<Object>> e : abc.entrySet()){
  String key = e.getKey();
  for(Objects o : e.getValue()){
     System.out.println(o.toString());
  }   
}
levacjeep
  • 673
  • 3
  • 6
  • 23