How do I read text from standard input?
Created May 4, 2012
John Zukowski System.in is the InputStream for standard input. The following demonstrating reading from it a line at a time:
InputStreamReader isr = new InputStreamReader(System.in); BufferedReader reader = new BufferedReader(isr); String line = null; while ((line = reader.readLine()) != null) { // Process line }