Serializable is an interface that "defines" two methods, readObject and writeObject.
I write "defines" because you will not get a compilation error if you declare a
class as serializable without implementing these two;
Code:
private void writeObject(java.io.ObjectOutputStream out)
throws IOException
private void readObject(java.io.ObjectInputStream in)
throws IOException, ClassNotFoundException;
As it works; the writeObject method writes the data to the stream and readObject
must be designed to read the same data, in the same sequence, back again.
Bookmarks