-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCat.java
More file actions
25 lines (21 loc) · 730 Bytes
/
Copy pathCat.java
File metadata and controls
25 lines (21 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import java.io.*;
/**
This class demonstrates how to read a line of text from the keyboard
Based on http://www.abbeyworkshop.com/howto/java/readLine/ReadLine.java
*/
public class Cat{
public static void main(String[] args){
try {
String CurLine = ""; // Line read from standard in
InputStreamReader converter = new InputStreamReader(System.in);
BufferedReader in = new BufferedReader(converter);
CurLine = in.readLine();
while (CurLine != null){
System.out.println(CurLine);
CurLine = in.readLine();
}
}catch (IOException e){
System.out.println("IO Exception\n");
}
}
}