Transient keyword is used in serialization process to prevent any variable from being serialized.
During Serialization all properties of object gets saved except static and transient. So if we would like to exclude any property of an object from being serialized we mark it transient and then JVM doesn't serialize it.