1.Consider a case where we are serializing an object on one machine and transporting to some other machine.On the other side besides class files,what all information do we need?
2.Another case lets suppose we are serializing an object and transporting to some other machine.But there class file does not conatin one method which that serialized object has.So in this case some exception wud be thrown.But will that exception wud be thrown when method call is invoked or when object is recreated.
1. The class files for all of the objects serialized - the serialVersionUID in each must match that in the machine that wrote the object. 2. If the serialVersionUID's don't match you get an immediate InvalidClassException. If you force the serialVersionUIDs to match you would get another exception when the method was invoked. See the discussion of java.io.Serializable in the JavaDocs Bill