// Demonstreerib readLine(). import java.io.*; class ReadLines { public static void main(String args[]) throws IOException { // luua DataInputStream kasutades System.in DataInputStream inData = new DataInputStream(System.in); String str; System.out.println("Sisesta tekstiread."); System.out.println("Lõpetamiseks 'stop' ."); do { str = inData.readLine(); System.out.println(str); } while(!str.equals("stop")); } }