Originally Posted by hypertone
Interesting. I haven't learned about the next() command or the tokenizer yet. Guess I'm gonna start over and because I don't want to use something I haven't learned yet. Thanks for the information guys!
Scanner has several fetch methods within it. Next, nextline, nextint, nextdouble, etc, etc. Nextline I would typically use to pull out something complex, and then use the string tokenizer to break it down further or pattern match what I need.
Using input like so:
Could bet fetched with two calls to next() followed by nextint(). Word of caution goes against using next* methods with nextline, the next based methods typically leave the line feeds on the scanner, so you should invoke the flush() before using nextline in that situation to prevent the scanner from looping.