Search:

Type: Posts; User: curmudgeon

Search: Search took 0.12 seconds.

  1. [SOLVED] Re: Ned help with this: Exception in thread "main" java.util.NoSuchElementException

    You're welcome, and glad you've got things working now. You seem to be able to grasp things quickly and willing to experiment, so I predict much success with you and your Java coding education. Best...
  2. [SOLVED] Re: Ned help with this: Exception in thread "main" java.util.NoSuchElementException

    When the going gets tough, the tough do some more debugging. Consider printing out each token to see what the split results in. You're somehow reading in a short line in there somewhere.
  3. [SOLVED] Re: Ned help with this: Exception in thread "main" java.util.NoSuchElementException

    Myself, I'd use String#split("~") for what you're doing, which would return an array of tokens, and then I'd check the length of this array before processing it.

    Can you post your output without...
  4. [SOLVED] Re: Ned help with this: Exception in thread "main" java.util.NoSuchElementException

    Thanks for the updated information! Now for more questions: Do you have any empty lines in your text file? Do you check for that before trying to extract tokens? Have you tried to debug your code?...
  5. [SOLVED] Re: Ned help with this: Exception in thread "main" java.util.NoSuchElementException

    I see potential for problems here:



    System.out.println("What is the employee's last name?");
    String lastName = keyboard.nextLine();

    System.out.println("What is the...
  6. [SOLVED] Re: Ned help with this: Exception in thread "main" java.util.NoSuchElementException

    Please indicate with an obvious comment which line in the code above is causing this exception to be thrown. By obvious comment, I mean something like // **** the error is here ****.
Results 1 to 6 of 6