Is java object serialization compatible between 1.5 and 1.6

前端 未结 8 1895
灰色年华
灰色年华 2020-12-18 19:48

I am wondering whether it is safe to mix jdk 1.5 and 1.6 (Java 6) object serialization (biderctional communication). I searched for an explicit statement from sun concerning

8条回答
  •  眼角桃花
    2020-12-18 20:17

    I would quickly add that it is possible to change the class but forget to change the serialVersionUID. So it is incorrect that "If the class defines a serialVersionUID, and this does not change, the class is guaranteed to be compatible." Rather, having the same serialVersionUID is the way an API promises backward compatibility.

提交回复
热议问题