posted 16 years ago
Let me show you what it means with an example.
Let's say you have a non-serializable Parent class
Now let's define a Child class, and make it Serializable:
Now let's define a Child object
Now, let's serialize the child object:
Now, let's deserialize it in the same object reference:
Now, let's print the deserialized object:
As you can see, the deserialization process did not set the value of the variable x, because it belongs to the Parent class, which is not serializable.
In other words, only the Child class was serialized.
I hope this helps!