Results 1 to 2 of 2
  1. #1
    headlice1 is offline Member
    Join Date
    Aug 2007
    Rep Power

    Talking a no such element exception


    im new to the java forums and was wondering how to get rid of no such element exceptions any hints :confused:

  2. #2
    goldhouse is offline Senior Member
    Join Date
    Mar 2007
    Rep Power


    Can You please eloborate the situation ?
    In the Java Doc of Enumeration Class it says
    Java Code:
    public Object nextElement()
        Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
            the next element of this enumeration. 
            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

Similar Threads

  1. How to use Idref Element and its advantages
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-30-2008, 10:04 AM
  2. Replies: 1
    Last Post: 03-08-2008, 06:41 PM
  3. Unique element in an array
    By revathi17 in forum New To Java
    Replies: 2
    Last Post: 12-31-2007, 08:44 AM
  4. Max element in an Array
    By mew in forum New To Java
    Replies: 5
    Last Post: 12-03-2007, 05:26 PM
  5. Replies: 4
    Last Post: 07-31-2007, 05:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts