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...
Type: Posts; User: Norm
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...
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...
See the end of post#2 re nextLine()
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...