OnJava8-Examples/io/Echo.java

19 lines
494 B
Java
Raw Normal View History

2015-09-07 11:44:36 -06:00
// io/Echo.java
2015-06-15 17:47:35 -07:00
// <20>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
}
2015-09-07 11:44:36 -06:00
}
/* Output: (None) */