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

    Talking a no such element exception

    Hi

    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
    Posts
    134
    Rep Power
    0

    Default

    Can You please eloborate the situation ?
    In the Java Doc of Enumeration Class it says
    Java Code:
    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

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, 11:04 AM
  2. Replies: 1
    Last Post: 03-08-2008, 07:41 PM
  3. Unique element in an array
    By revathi17 in forum New To Java
    Replies: 2
    Last Post: 12-31-2007, 09:44 AM
  4. Max element in an Array
    By mew in forum New To Java
    Replies: 5
    Last Post: 12-03-2007, 06:26 PM
  5. Replies: 4
    Last Post: 07-31-2007, 06: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
  •