How to get the standard input in Java
Written on January 13, 2010 at 1:12 am by
mkyong
A quick example to show how to read the standard input in Java.
package com.mkyong.io; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class printStdIn{ public static void main (String args[]) { try{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String input; while((input=br.readLine())!=null){ System.out.println(input); } }catch(IOException io){ io.printStackTrace(); } } }
Oracle Magazine (Free)
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world\'s largest enterprise software company.
Publisher : Oracle Corporation


