In Java, what is the Scanner class used for?
Advertisement
Answer
See the Javadoc:
A simple text scanner which can parse primitive types and strings using regular expressions.
Basically, you can initialize a Scanner with some input stream and a format or delimiter, then use it to iterate over “tokens” (broken-up chunks of text) that it generates from that input stream with the delimiter info you give it.