¿¹Á¦

public static class SerializableObject implements Serializable{

public void writeObject(ObjectOutputStream s) throws IOException {
s.defaultWriteObject();
}

public void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
s.defaultReadObject();
}

static final long serialVersionUID = 123;
}

¼Ö·ç¼Ç
readObject() ¹× writeObject() privateÀ» ¼±¾ðÇϽʽÿÀ.

public static class SerializableObject implements Serializable{

private void writeObject(ObjectOutputStream s) throws IOException {
s.defaultWriteObject();
}

private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
s.defaultReadObject();
}

static final long serialVersionUID = 123;
}