版权声明:随便转载了.............. https://blog.csdn.net/lijingshan34/article/details/78071887
a)Make a FileOutputStream
java 代码
FileOutputStream fs = new FileOutputStream(“foo.ser”);
b)Make a ObjectOutputStream
java 代码
ObjectOutputStream os = new ObjectOutputStream(fs);
c)write the object
java 代码
os.writeObject(myObject1);
os.writeObject(myObject2);
os.writeObject(myObject3);
d) close the ObjectOutputStream
java 代码
os.close();