Java serialization provides a mechanism for persistence object instances. When a persistent object is stored, there may be a special object data member. We do not want to use the serialization mechanism to save it. To disable serialization on a domain of a specific object, you can add the keyword transient before this domain. Transient is a keyword of the Java language used to indicate that a domain is not part of the object's serialization. When an object is serialized, the value of the transient variable is not included in the serialized representation. However, non-transient variables are included. Transient indicates that an attribute is temporary and will not be serialized.
Example: Class A implements serializable {
Private string name;
Transient private string address;
}
when you are serializing Class A (IO stream, etc, assign values to the name and address attributes of a, so you get the name attribute while extracting a, but cannot get the address attribute.