I need to compare 2 hashmaps.If the values of same key in both hashmaps doesnt match, I need to display both the values.How do I extract these values and keys from a hashmap??
Any help would be greatly appreciated.
Thanks in advance,
SystemAdmin 110000D4XK2768 Posts
Re: HashMap Comparison2007-06-21T04:06:33ZThis is the accepted answer. This is the accepted answer.HashMap.equals() will tell you if two maps are equal. (Check the API for more exact definition of how this works.)
You can go through every Key-Value pair in the HashMap using the HashMap.entrySet() method to extract a reference to the actual Collection of "Map.Entry" objects.
Use a Iterator to go through all of them, if you need to check each of the internal entries.
gr8yash 270001YQTB3 Posts