// simple example of reading a line of text from the keyboard import java.io.*; public class EchoLine { public static void main(String[] args) { try { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); System.out.print("Enter line: "); String oneLine = in.readLine(); System.out.println("You typed: " + oneLine); } catch (IOException e) { System.out.println(e); } } }