Java static serialization rules?
问题 I\'m working on a save state serialization with a few static methods and fields. I could have sworn though that serialization and static\'s caused mayhem. Should I make all static\'s transient? And will inflating the calls restore the statics as normal? 回答1: 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