import java.io.IOException;
02. import java.io.InputStream;
03.
04. public class ReadKey{
05. public static void main(String[] args) throws IOException {
06. readKey();
07. }
08.
09. public static void readKey() throws IOException {
10. InputStream in = System.in;
11.
12. int ch = in.read();// 阻塞式方法
13. System.out.println(ch);
14.
15 ch = in.read(); // 阻塞式方法
16. System.out.println(ch);
17.
18. ch = in.read(); // 阻塞式方法
19. System.out.println(ch);
20.
21. in.close();
22. }
23. } |
|