public class TestClass
{
public static void main(String[] args) throws
Exception
{
SerialClass s = new SerialClass();
s.setA(10);
s.setB("hello");
s.setC("world");
//创建ObjectOutputStream对象,准备序列化对象s
ObjectOutputStream oos = new
ObjectOutputStream(
new FileOutputStream("abc"));
//调用writeObject将对象进行序列化,存储在文件