File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes serialization and VM Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "serialization and VM" Watch "serialization and VM" New topic
Author

serialization and VM

M Mistroni
Ranch Hand

Joined: Oct 03, 2005
Posts: 62
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
Mujahid Al-okaidi
Greenhorn

Joined: May 31, 2008
Posts: 8
I remember a question on this in the exam and I think the answer was yes.
Antonio Tercero
Ranch Hand

Joined: Jun 05, 2008
Posts: 110
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).


SCJP 5, SCWCD 5
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6657
    
    5

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.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: serialization and VM
 
Similar Threads
Execute startup script in Linux
Compilling JSPs at starttup time ?
Tomcat running in background
EJB Deployement on WAS
Compilling JSPs at starttup time ?