Transient variables in Java

Java’s serialization provides an elegant, and easy to use mechanism for making an object’s state persistent. While controlling object serialization, we might have a particular object data member that we do not want the serialization mechanism to save.   The modifier transient can be applied to field members of a class to turn off serialization ...