Are static variables serialized in Serialization process

后端 未结 9 1633
深忆病人
深忆病人 2020-12-04 12:30

I\'m stumbled upon understanding java serialization. I have read in many documents and books that static and transient variables cannot be serialized in Java. We declare a

9条回答
  •  抹茶落季
    2020-12-04 13:13

    No, if a class have static variable then at the time of serialization that variable will be skipped . because static variable is unique for all object and serialization is used for only save the object properties ( state of object ). static variable is a property of class

提交回复
热议问题