Search:

Type: Posts; User: Norm

Search: Search took 0.18 seconds.

  1. Replies
    8
    Views
    1,330

    Re: my do while isn't behaving (beginner)

    The String class has methods for testing if a String is empty, use one of them.


    if (input == " ");
    Several problems with that line of code:
    Use the equals() method when comparing the contents...
  2. Replies
    8
    Views
    1,330

    Re: my do while isn't behaving (beginner)

    The Scanner class's method nextDouble() leaves a endline char in the Scanner's buffer that the nextLine() method reads and returns as an empty String. To get the user's input, another call to...
  3. Replies
    8
    Views
    1,330

    Re: my do while isn't behaving (beginner)

    See the end of post#2 re nextLine()
  4. Replies
    8
    Views
    1,330

    Re: my do while isn't behaving (beginner)

    Please copy the full text of the error message and paste it here. It has important info about the error.

    If the index of 0 is out of bounds, then the String must be empty.
    The Scanner's...
Results 1 to 4 of 4