import java.io.*;
public class SimpleIO
{
public static void main(String [ ]args)
{
String s="";
System.out.println("请输入一个字符串:");
try{
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
s=in.readLine();
}catch(IOException e){System.out.println("产生异常");}
System.out.println("你输入的字符串是"+s);
}
}
public static void main(String args[]){
int count;
byte buf[]=new byte[255];
System.out.print("提示输入:");
try{
count=System.in.read(buf);
String str=new String(buf,0,count-2);
System.out.print("输出"+str);
}
catch(IOException e){
//捕获异常
}
}