| 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: 6603
|
|
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 - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
|
 |
 |
|
|
subject: serialization and VM
|
|
|