当使用 java 自带的序列化方式序列化对象时, 如果想要排除掉某些属性, 可以使用 transient 关键字修饰 // 该属性不再被序列化和反序列化 private transient String name;