-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReadLine.java
More file actions
21 lines (15 loc) · 614 Bytes
/
Copy pathReadLine.java
File metadata and controls
21 lines (15 loc) · 614 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import java.io.*;
class ReadLine{
public static void main(String[] args) throws IOException{
String CurLine = ""; // Line read from standard in
System.out.println("Enter a line of text (type 'quit' to exit): ");
InputStreamReader converter = new InputStreamReader(System.in);
BufferedReader in = new BufferedReader(converter);
while (!(CurLine.equals("quit"))){
CurLine = in.readLine();
if (!(CurLine.equals("quit"))){
System.out.println("You typed: " + CurLine);
}
}
}
}