< prev index next > src/java.base/share/classes/java/io/Serializable.java
Print this page
*
* Record classes can implement {@code Serializable} and receive treatment defined
* by the <a href="{@docRoot}/../specs/serialization/serial-arch.html#serialization-of-records">
* <cite>Java Object Serialization Specification,</cite> Section 1.13,
* "Serialization of Records"</a>. Any declarations of the special
! * handling methods discussed above are ignored for record types.<p>
*
* 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.
*
* Record classes can implement {@code Serializable} and receive treatment defined
* by the <a href="{@docRoot}/../specs/serialization/serial-arch.html#serialization-of-records">
* <cite>Java Object Serialization Specification,</cite> Section 1.13,
* "Serialization of Records"</a>. Any declarations of the special
! * handling methods discussed above, except {@code writeReplace},
+ * are ignored for record types.<p>
+ *
+ * Value classes can implement {@code Serializble} and receive the treatment defined
+ * by the <a href="{@docRoot}/../specs/serialization/serial-arch.html#serialization-of-value-objects">
+ * <cite>Java Object Serialization Specification,</cite> Section 1.14,
+ * "Serialization of Value Objects"</a>. Any declarations of the special
+ * handling methods discussed above, except {@code writeReplace},
+ * are ignored for value classes. Value classes implementing {@link Externalizable}
+ * and not using {@code writeReplace} are not supported.<p>
*
* 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.
< prev index next >