Can You please eloborate the situation ?
In the Java Doc of Enumeration Class it says
nextElement
public Object nextElement()
Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
Returns:
the next element of this enumeration.
Throws:
NoSuchElementException - if no more elements exist.
So If you call nextElement without checking hasmoreElements you will get this exception Avoid this you will get the problem out