java 字节流和字符流转换类InputStreamReader,OutPutStreamReader

java 字节流和字符流转换类InputStreamReader,OutPutStreamReader

java 字节流和字符流转换类InputStreamReader,OutPutStreamReader

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

java 字节流和字符流转换类InputStreamReader,OutPutStreamReader,布布扣,bubuko.com

java 字节流和字符流转换类InputStreamReader,OutPutStreamReader

上一篇:java SequenceInputStream


下一篇:java DataOutputStream和DataInputstream