OnJava8-Examples/io/Echo.java
Bruce Eckel 49edcc8b17 reorg
2015-06-15 17:47:35 -07:00

18 lines
499 B
Java

//: io/Echo.java
// ©2015 MindView LLC: see Copyright.txt
// How to read from standard input.
// {TimeOutDuringTesting}
import java.io.*;
public class Echo {
public static void main(String[] args)
throws IOException {
BufferedReader stdin = new BufferedReader(
new InputStreamReader(System.in));
String s;
while((s = stdin.readLine()) != null && s.length()!= 0)
System.out.println(s);
// An empty line or Ctrl-Z terminates the program
}
} /* Output: (None) *///:~