Search:

Type: Posts; User: Norm

Search: Search took 0.12 seconds.

  1. Replies
    9
    Views
    1,905

    Re: Scanner not working properly.

    Did you try what I recommended earlier:
    You must call nextLine() to clear the newline character from Scanner's buffer.
    nextInt leaves the newline in the buffer.
    Call nextLine to clear it.
  2. Replies
    9
    Views
    1,905

    Re: Scanner not working properly.

    From post #4
    I suspect the problem is with the newline character being left in the Scanner class's buffer after calling nextInt()
    You must call nextLine() to clear the newline character from...
  3. Replies
    9
    Views
    1,905

    Re: Scanner not working properly.

    Does it work now?
  4. Replies
    9
    Views
    1,905

    Re: Scanner not working properly.

    Can you show what the problem is? Add some comments to what you posted to show where the problem is.

    I suspect the problem is with the newline character being left in the Scanner class's buffer...
  5. Replies
    9
    Views
    1,905

    Re: Scanner not working properly.

    Please explain. Post the full contents of the console showing what happened.

    What method is trying to read what you are entering?
    nextInt() only accepts numeric digits.
Results 1 to 5 of 5