How do I read formatted input from the command line?
Location: http://www.jguru.com/faq/view.jsp?EID=1251268 Created: Jun 30, 2005 Author: John Zukowski (http://www.jguru.com/guru/viewbio.jsp?EID=7) 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.