Search:

Type: Posts; User: Norm

Search: Search took 0.43 seconds.

  1. Re: Cant seem to get my loop to work after catching an exception.

    From that I assume that if the translation is NOT successful, the scanner does NOT advance, ie it leaves the bad data in the buffer.

    I used buffer in the generic sense referring to a place in the...
  2. Re: Cant seem to get my loop to work after catching an exception.

    You can use another Scanner class method to read the bad data from the Scanner's buffer.
    For debugging you should also print out a message showing the bad data that was read.
  3. Re: Cant seem to get my loop to work after catching an exception.

    Did you read and understand the rest of my post#11?
  4. Re: Cant seem to get my loop to work after catching an exception.

    Can you copy the first part of the console showing what was entered and what the code printed out?

    Read the API doc for the nextDouble() method to see what it does:
    when there is good data
    when...
  5. Re: Cant seem to get my loop to work after catching an exception.

    Look at the code. Does it do that?

    EDIT: Looks like Greg has fixed it for you.
  6. Re: Cant seem to get my loop to work after catching an exception.

    The while() loop will continue to execute as long as the expression inside of the loop has a true value.
    What was the value of the expression in the while loop when it executed? For the loop to...
  7. Re: Cant seem to get my loop to work after catching an exception.

    Please edit your post and wrap your code with code tags:


    YOUR CODE GOES HERE

    to get highlighting and preserve formatting.


    What would keep the loop executing? What is the value of the...
Results 1 to 7 of 7