IO中的字节流练习
1. FileInputStream FileOutputStream通过字节流来读写文件
public static void main(String[] args){File f = new File("d:\\dmeo.txt");String studentName = "TOM";int age = 20;double totalScore = 600.0f;PrintStream ps = null;try {ps = new PrintStream(new FileOutputStream(f));} catch (FileNotFoundException e) {e.printStackTrace();}//格式化后输出ps.printf("姓名:%s , 年龄:%d , 总分:%3.1f",studentName,age,totalScore);}