0
How do you iterate through a HashMap with the iterator object
2 ответов
+ 3
Create entrySet() then create iterator for it.
HashMap hm = new HashMap() ;
Iterator it = hm.entrySet().iterator();
Now it.next() returns a mapEntry() which have key, value pair.
MapEntry<> e = it.next() ;
e.getKey() returns key
m.getValue() returns value...
Hope it helps...
+ 2
I hope this link helps you
https://www.sololearn.com/compiler-playground/ceDlHzkP8i5H