Editorial / Best Answer
sivagopal
A variable that won't be allowed for object serialisation. so that the state
of the value will always be defaulted after the deserialisation.
For example a variable x's value is set to 9, it's default value is '0' say,
when the object has been serialized having x's value 9, after deserialisation
will be defaulted to '0'
Use: In Java, serialization of an object allowed only when all the underlying
objects of the object that is currently under serialization contains has a
relationship, will not be allowed, some times the developer has no choice of
implementing serializable marker interface on some classes as the classes might
have been arrived from a third party and the developer has no control over them,
but the developer needs to serialize the object's state, then the developer has
the choice of marking the objects that not serializable as transient.
What is a transient variable
Editorial / Best Answer
sivagopalProfile Answers by sivagopal Questions by sivagopal
A variable that won't be allowed for object serialisation. so that the state of the value will always be defaulted after the deserialisation.
For example a variable x's value is set to 9, it's default value is '0' say, when the object has been serialized having x's value 9, after deserialisation will be defaulted to '0'
Use: In Java, serialization of an object allowed only when all the underlying objects of the object that is currently under serialization contains has a relationship, will not be allowed, some times the developer has no choice of implementing serializable marker interface on some classes as the classes might have been arrived from a third party and the developer has no control over them, but the developer needs to serialize the object's state, then the developer has the choice of marking the objects that not serializable as transient.
Related Answered Questions
Related Open Questions