Forums Register Login

serialization and VM

+Pie Number of slices to send: Send
hi all,
suddenly i m having a doubt about serialization and cannot find answers on the net.
If i serialize an object using JVM1, and then try to deserialize it using JVM2, will it work?
i mean, serialization / deserialization works across different java virtual machines?
i m guessing that answer is yes...

thanks and regards
marco
+Pie Number of slices to send: Send
I remember a question on this in the exam and I think the answer was yes.
+Pie Number of slices to send: Send
Yes, it works.
When you serialize an object to a file in one JVM you can deserialize that object from another JVM (simply reading the file).
+Pie Number of slices to send: Send
 

Originally posted by M Mistroni:
hi all,
suddenly i m having a doubt about serialization and cannot find answers on the net.
If i serialize an object using JVM1, and then try to deserialize it using JVM2, will it work?
i mean, serialization / deserialization works across different java virtual machines?
i m guessing that answer is yes...

thanks and regards
marco



Yes you can do that. That is the purpose of serialization. You can also serialize and deserialize across different versions of the JVM as long as the serialversionuid is overridden and the JVM loading the class has a version that is the same or higher than the JVM that serialized the class.
God is a comedian playing for an audience that is afraid to laugh - Voltair. tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 780 times.
Similar Threads
Execute startup script in Linux
Tomcat running in background
EJB Deployement on WAS
Compilling JSPs at starttup time ?
Compilling JSPs at starttup time ?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:13:43.