Quantcast
Channel: Reza's Weblog
Viewing all articles
Browse latest Browse all 50

Iterating a Map

$
0
0

I am sorry to post this fairly simple piece of code here but I usually forget how to iterate a Map so I wire it here not to forget it again:

                    Iterator it = themap.entrySet().iterator();
                    while (it.hasNext()) {
                        Map.Entry pairs = (Map.Entry)it.next();
                        pairs.getKey();
                        pairs.getValue();
                    } 

 


Viewing all articles
Browse latest Browse all 50

Trending Articles