but my question is when we have iterator with all facilities , why we need to have Enumerator which is only used just for read only ?Enumeration+ came first, and Iterator was added with the collection classes in 1.2. The basic reasons are given in the Javadoc for Iterator.
and what is the specific reason for which the enumeration cannot be used for traversing through HashMaps?You can't iterate the map either. You can iterate through the entrySet(), or the keySet(), or the values(). You can't enumerate those because they are part of the Collections API that was introduced in 1.2 and they weren't retrofitted to use Enumeration; Iterator being clearly considered to have superceded it.
please reply in detail for both the questions.Both these questions are answered in all available detail by the Javadoc. No further details are available unless you can find the designers of the Collections API.