I want to do the below, would it theoretically work? (I am working on coding it and checking but that is taking some time)
Question: Would the above work without JVM having the class loaded corresponding to the serialized object?
Serialized Java Objects can only be deserialized iff
The second point is really critical. Default Java serialization is very brittle because if you update your class, you won't be able to deserialize objects serialized with a previous version.
The better way to serialize objects is to use XML or JSON. There are popular Java libraries for doing this.