Home > DeveloperSection > Forums > What is the use of transient keyword in java
Mark Devid
Mark Devid

Total Post:102

Posted on    February-27-2015 10:49 PM

 Java Java 

 1 Reply(s)
 762  View(s)
Rate this:
What is  the use of transient keyword in java ?

Mayank Tripathi
Mayank Tripathi

Total Post:397

Posted on    February-27-2015 11:17 PM


·         transient keyword is used when we are Serializing an object.

·         The keyword transient in Java used to indicate that the variable should not be serialized By default all the variables in the object is converted to persistent state.

·         In some cases, you may want to avoid persisting some variables because you don’t have the necessity to transfer across the network. So, you can declare those variables as transient.

·         If the variable is declared as transient, then it will not be persisted. It is the main purpose of the transient keyword.



Don't want to miss updates? Please click the below button!

Follow MindStick