---------------------- ASP.Net+Android+IOS開發、.Net培訓、期待與您交流!
----------------------
打印流:
該流提供了打印方法,可以將各種數據類型的數據都原樣打印。字節打印流:
PrintStream
構造函數可以接收的參數類型:
1,file對象。File
2,字符串路徑。String
3,字節輸出流。OutputStream
4,字符輸出流,Writer
字符打印流:
PrintWriter
import java.io.*;
class PrintStreamDemo
{
public static void main(String[] args) throws IOException
{
BufferedReader bufr=
new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(new BufferedWriter (new FileWriter("a.txt",true)));
String line = null;
while((line = bufr.readLine())!=null)
{
if("over".equals(line))
break;
out.println(line.toUpperCase());
//out.flush();
}
out.close();
bufr.close();
}
}
---------------------- ASP.Net+Android+IOS開發、.Net培訓、期待與您交流!
----------------------詳細請查看:http://edu.csdn.net