In Java, the transient keyword is used to mark a member variable (field) not a part of the persistent state of an object, i.e. the field will not be persisted when its parent object is serialized.
The following example shows a class which has a transient variable:
class Rectangle { int width; int height; transient long area; }
When an object of Rectangle class is being serialized, the fields width and height will be persisted, but the field area.
The transient keyword can be only applied for member variable, not for class, method and local variable.
See all keywords in Java.