static
s are implicitly transient
, so you don't need to declare them as such.
Serialization is for serializing instances, not classes. static
fields (methods are irrelevant since they are part of the class definition so they aren't serialized) will be reinitialized to whatever value they are set to when the class is loaded.
If you have a mutable static
field, then the changes made to that value will be lost.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…