POJO 序列化

public class User implements java.io.Serializable {

// Fields

private Integer userId;
private String userName;
private String userPwd;
private Date createTime;

// Constructors

/** default constructor */
public User() {
}

/** full constructor */
public User(String userName, String userPwd, Date createTime) {
this.userName = userName;
this.userPwd = userPwd;
this.createTime = createTime;
}

// Property accessors

public Integer getUserId() {
return this.userId;
}

public void setUserId(Integer userId) {
this.userId = userId;
}

public String getUserName() {
return this.userName;
}

public void setUserName(String userName) {
this.userName = userName;
}

public String getUserPwd() {
return this.userPwd;
}

public void setUserPwd(String userPwd) {
this.userPwd = userPwd;
}

public Date getCreateTime() {
return this.createTime;
}

public void setCreateTime(Date createTime) {
this.createTime = createTime;
}

}
序列化是一种用来处理对象流的机制,所谓对象流也就是将对象的内容进行流化。可以对流化后的对象进行读写操作,也可将流化后的对象传输于网络之间。序列化是为了解决在对对象流进行读写操作时所引发的问题。

你可能感兴趣的:(POJO)