java中序列化如果有些字段不想进行序列化怎么办

2022年11月2日09:28:17

对于不想被序列化的变量,用transient关键字修饰。transient关键字的作用就是:阻止用这个关键字修饰的不想被序列化的变量序列化;transient只能修饰变量,不能修饰类和方法。

  • 作者:ThunderWay
  • 原文链接:https://blog.csdn.net/qq_38197844/article/details/108964610
    更新时间:2022年11月2日09:28:17 ,共 95 字。