Transient variable in Java is a variable whose value is not serialized during Serialization and which is initialized by its default value during de-serialization, for example for object transient variable it would be null. this behavior can be customized by using Custom Serialized form or by using Externalizable interface. transient variable is used to prevent any object from being serialized and you can make any variable transient by using transient keyword. By the way difference between transient and volatile variable in Java is a famous Java interview question but transient variable is completely different than volatile variable which we have discussed in our post What is volatile variable in Java. In next section we will see complete example of serialization where we will first serialize an instance of Book class which implements Serializable and than de-serialize to see What is the value of transient variable after deserialization.