What is the reserved keyword transient used for?

Byron Tymvios

The transient keyword is used to tell Java that the specified variable should not be persisted when serializing an object. All nonserializable fields as well as fields that you do not want to persist should be marked as transient. When an object is serialized the fields marked as transient will not have their data persisted, therefore when the object is deserialized these variables will have no data.

It is used as follows when declaring variables:

private transient String doNotPersist = "Some String";