标签:java 字节流和字符流转化 inputstreamreader outputstreamreader
import java.io.*;
public class BufferDemo
{
public static void main(String[] args) throws IOException
{
BufferedReader buf=null;
buf=new BufferedReader(new InputStreamReader(System.in));
System.out.print("Please enter a number:");
String str=buf.readLine();
//将字符串解析为整数
int i=Integer.parseInt(str);
i=i+10;
System.out.println("The modified number is "+i+".");
}
}
java 字节流和字符流转换类InputStreamReader,OutPutStreamReader,布布扣,bubuko.com
java 字节流和字符流转换类InputStreamReader,OutPutStreamReader
标签:java 字节流和字符流转化 inputstreamreader outputstreamreader
原文地址:http://blog.csdn.net/cjc211322/article/details/24909295