How do I read formatted input from the command line?
Created May 8, 2012
John Zukowski The
java.util.Scanner
constructor takes a file, channel, input stream, or reader as an argument and lets you read an int (with nextInt()), read a line (with nextLine()), or any other data type with an aptly named next*() method.