Hi
im new to the java forums and was wondering how to get rid of no such element exceptions any hints :confused:
Printable View
Hi
im new to the java forums and was wondering how to get rid of no such element exceptions any hints :confused:
Can You please eloborate the situation ?
In the Java Doc of Enumeration Class it says
So If you call nextElement without checking hasmoreElements you will get this exception Avoid this you will get the problem outCode: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.