How to serialize static data members of a Java class?
问题 When we serialize objects, static members are not serialized, but if we need to do so, is there any way out? 回答1: The first question is why you need to serialize the static members? Static members are associated with the class, not the instances, so it does not make sense to include them when serializing an instance. The first solution is to make those members not static. Or, if those members are the same in the original class and the target class (same class, but possibly different runtime