Java中关于JSON对象类型和字符串类型之间互相转化(3)

public class User {
    private int id;
    private String name;
    private String password;
    private Date date;
    public int getId() {
        return id;
    }
    public void setId(int id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public Date getDate() {
        return date;
    }
    public void setDate(Date date) {
        this.date = date;
    }
    public User(int id, String name, String password, Date date) {
        super();
        this.id = id;
        this.name = name;
        this.password = password;
        this.date = date;
    }
   
    public User(){
       
    }
   
    @Override
    public String toString() {
        return "Id:"+this.getId()+"\n"+"name:"+this.getName()+"\n"+"password:"+this.getPassword();
    }
}

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/38a0381c0009d4af6316784467caedd5.html