Friday 22 January 2016

java - Why jvm generates serialVersionUID?

As per docs:




The serialization runtime associates with each serializable class a version number, called a serialVersionUID, which is used during deserialization to verify that the sender and receiver of a serialized object have loaded classes for that object that are compatible with respect to serialization.




If serialVersionUID is only meant to verify whether the sender and receiver of a serialized object have loaded classes for that object, then cant the class name itself be used by jvm for verification.

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...