封装输入流
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 }