//******************************************************************** // EchoStd.java // by Omar Hamadache // // Demonstrates the use of the standart system.io to read a string //******************************************************************** import java.io.* ; public class EchoStd { //----------------------------------------------------------------- // Reads a character string from the user and prints it. //----------------------------------------------------------------- public static void main (String[] args) { String line; System.out.println ("Enter a line of text:"); try { InputStreamReader isr = new InputStreamReader (System.in); BufferedReader stdin = new BufferedReader (isr); line = stdin.readLine(); System.out.println("You entered: \"" + line + "\""); } catch (IOException exception) { System.out.println (exception); } } }