I read the API for Java because I had a question about the difference between .nextLine() and .nextDouble() . In the API, this talks about this for .nextLine() :
"Adapts this scanner to the current line and returns the missing input. This method returns the remainder of the current line, with the exception of the line separator at the end. The position is set to the beginning of the next line."
Easy enough ... it skips the current line you're on, and then returns a line that you just skipped. But for .nextDouble() it says the following:
"Scans the next input token as double. This method will throw an InputMismatchException if the next token cannot be converted to a valid double value. If the transfer is successful, the scanner moves past the input file that matches."
Does this mean that .nextDouble() does not jump to a new line and that it reads only to the end of the double and then stops at the end of the line? This will help me understand the program I'm currently working on. Thank you guys and girls!
source share