美文网首页
IO流使用时属性类的序列化问题

IO流使用时属性类的序列化问题

作者: 堂哥000 | 来源:发表于2018-12-01 10:04 被阅读3次

    实现序列化接口,并且设置序列化ID用final来保证唯一不可变的特性

    public class User  implements Serializable {
        private static final long serialVersionUID = 1L;
             private String name;
             getter和setter方法
             构造方法
             toString方法
             equal和hascode方法
    }
    

    相关文章

      网友评论

          本文标题:IO流使用时属性类的序列化问题

          本文链接:https://www.haomeiwen.com/subject/wdelcqtx.html