1:import java.io.*; 2: 3:/** 4: This class demonstrates how to read a line of text from the keyboard 5:*/ 6:class ReadLine{ 7: public static void main(String[] args) throws IOException{ 8: String CurLine = ""; // Line read from standard in 9: 10: System.out.println("Enter a line of text (type 'quit' to exit): "); 11: InputStreamReader converter = new InputStreamReader(System.in); 12: BufferedReader in = new BufferedReader(converter); 13: 14: 15: while (!(CurLine.equals("quit"))){ 16: CurLine = in.readLine(); 17: 18: if (!(CurLine.equals("quit"))){ 19: System.out.println("You typed: " + CurLine); 20: } 21: } 22: } 23:}