Styrow.dev
Question 108 of 247
Java Topic: General medium

What is a transient variable?

Question

What is a transient variable?

Answer

If some of the properties of a class are not required to be serialized then the varaibles are marked as transient. When an object is deserialized the transient variables retains the default value depending on the type of variable declared and hence lost its original value.