package com.d04_file.itheima12;
import com.d04_file.itheima12.Student;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
/*
对象序列化流(将对象信息存入文件中)
*/
public class ObjectOutputStreamDemo {
public static void main(String[] args) throws IOException {
ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("src\\com\\d04_file\\itheima12\\oos.txt"));
Student s = new Student("林青霞",30);
oos.writeObject(s);
oos.close();
}
}