static members are associated with the class, not the object, so when deserializing you will see the value you passed, not the default values โโshown when using the transient. To better understand, try changing the value of the variables after serialization, and then during deserialization you will see that the values โโof the serialized members are the same, but the static value has changed. According to the transitional final variable , the final variables participate in serialization directly by their values, so there is no need to declare the final variable as a transitional one.
source share