封装输入流

 1 package Iotext;
 2 
 3 import java.io.BufferedReader;
 4 import java.io.IOException;
 5 import java.io.InputStream;
 6 import java.io.InputStreamReader;
 7 
 8 
 9 /**
10  * 封装输入
11  */
12 
13 public class BuffereIn{
14     public static void main(String[] args) throws IOException{
15         InputStream is=System.in;
16         BufferedReader br=new BufferedReader(new InputStreamReader(is));
17 
18         System.out.println("请输入。。。。。");
19         String msg =br.readLine();
20         System.out.println(msg);
21     }
22 }

 

posted @ 2018-06-09 14:30  不停地走  阅读(202)  评论(0编辑  收藏  举报