Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我打算做一个研究,如果我尝试混合 java 1.5 和 1.6,请告知。例如,我有一个 java 1.5,我在 c:\ 驱动器中的一个文件中序列化了一个 java 对象,然后尝试在 java 1.6 中打开是否会有任何异常,如果我反之亦然..?
序列化机制本身并没有改变。对于个别班级,这将取决于具体班级。如果一个类有一个 serialVersionUID 字段,这应该表示序列化兼容性。
private static final long serialVersionUID = -7287480476309918049L; If it is unchanged, the serialized versions are compatible.