Most likely, you're confused because there are actually two different "readObject()" methods being used here. One is the "Object readObject()" method of ObjectInputStream, which is what TestSer is invoking. However, you can also implement a different readObject() method in the Serializable class itself to customize the serialization process. This other readObject() method has a different signature from the one invoked by TestSer: "void readObject(ObjectInputStream in)". Same thing with writeObject().
I always thought it was a little unfortunate that
Java's designers decided to use the same name for those two methods. Something like "readObject()" and "readThisObject()" would have been a bit better, in my opinion.