The default serialization mechanism for an object writes the class of
the object, the class signature, and the values of all non-transient
and non-static fields
- Is there any difference between “Class of the Object” and “Class Signature” here?
- Since “Class Signature” and the “Class” also passed, Does JVM loads the default class on the target system? (or) the class which is passed in the serialized object?
The phrase “writes the class of the object” really means “writes the class name of the object”. java object serialization does not write the class bytes, only the name of the class. when the object is deserialized later, it will use the class bytes defined in the current jvm.