please help clarifying the doubt :
While doing serialization, if we have defined the version id as
static final long serialVersionUID = 2L;, and since this being static it should not get serialize while storing the object to the persistent medium.
While reading the object back from persistent medium, how does the object match the versionID since the de serialized object should not contain it.
The serialization runtime adds the class’s
serialVersionUIDto the object stream automatically, it’s not treated like a “normal” instance field. This all happens under the covers.