Friday, 18 March 2016

What is a Transient variable ?


Variable that cannot be serialized.

If  variable is decalred as transient in a Serializable class and the class is written to an ObjectStream, the value of the variable can't be written to the stream instead when the class is retrieved from the ObjectStream, the value of the variable becomes null.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.