SAVE TIME AND ENERGY WITH THE MAP.ENTRY CLASS Are you tired of having to obtain the keys for a Map and then the value for each key? With the Map.Entry class, you can retrieve all of this information at the same time. The standard way to iterate over a Map is to enter the following: Set keys = map.keySet( ); if(keys != null) { Iterator iterator = keys.iterator( ); while(iterator.hasNext( )) { Object key = iterator.next( ); Object value = map.get(key); .... } } However, this method has one problem. After getting the keys from the Map, you have to go back to the Map each time to retrieve the value, which is tedious and time-consuming. Fortunately, there's a simpler way. The Map class provides a method called 'entrySet' that returns a Set of Map.Entry objects. The Map.Entry class then provides a getKey and a getValue method so the above code can be written more logically. For example: Set entries = map.entrySet( ); if(entries != null) { Iterator iterator = entries.iterator( ); while(iterator.hasNext( )) { Map.Entry entry = iterator.next( ); Object key = entry.getKey( ); Object value = entry.getValue( ); .... } } While this adds an extra line of code, it saves on the unnecessary 'get' call back to the Map and provides the developer with a useful class that holds both the key and the value. Map.Entry also provides a setValue method that allows the developer to change the value in the map. ----------------------------------------