public class User { private String username; private String password; private String confirmPassword; private Date birthday; } 构造函数、getter和setter方法
时间: 2023-07-15 12:10:07 浏览: 87
string类,构造函数...
public class User {
private String username;
private String password;
private String confirmPassword;
private Date birthday;
// 构造函数
public User(String username, String password, String confirmPassword, Date birthday) {
this.username = username;
this.password = password;
this.confirmPassword = confirmPassword;
this.birthday = birthday;
}
// getter方法
public String getUsername() {
return username;
}
public String getPassword() {
return password;
}
public String getConfirmPassword() {
return confirmPassword;
}
public Date getBirthday() {
return birthday;
}
// setter方法
public void setUsername(String username) {
this.username = username;
}
public void setPassword(String password) {
this.password = password;
}
public void setConfirmPassword(String confirmPassword) {
this.confirmPassword = confirmPassword;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
}
阅读全文