How does java serialization deserialize final fields when no default constructor specified?

前端 未结 3 816
伪装坚强ぢ
伪装坚强ぢ 2020-12-05 17:00

I have an class defining an immutable value type that I now need to serialize. The immutability comes from the final fields which are set in the constructor. I\'ve tried ser

3条回答
  •  醉梦人生
    2020-12-05 17:46

    Deserialization is implemented by the JVM on a level below the basic language constructs. Specifically, it does not call any constructor.

提交回复
热议问题