transient Java Keyword

The transient is a keyword defined in the java programming language.

transient Java Keyword

transient Java Keyword

     

The transient is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler in java programming language likewise the transient keyword indicates the following :

-- The transient keyword is applicable to the member variables of a class.
-- The transient keyword is used to indicate that the member variable should not be serialized when the class instance containing that transient variable  is needed to be serialized.

Example to use the transient keyword with a variable:

public class Class1{

private transient String password;
}