当前位置: 技术问答>java相关
一个Bean的错误(数据类型),请帮忙!!
来源: 互联网 发布时间:2015-10-25
本文导语: Bean的代码如下: ------------------- package login; public class Check { public String username; public String password; public String email; public Check() { username=""; password=""; email=""; } ...
Bean的代码如下:
-------------------
package login;
public class Check
{
public String username;
public String password;
public String email;
public Check() {
username="";
password="";
email="";
}
//get value
public String getUsername(){
return username;
}
public String getPassword(){
return password;
}
public String getEmail(){
return email;
}
//set value
public void setUsername(String usernamestr){
username=usernamestr;
}
public void setPassword(String passwordstr){
password=passwordstr;
}
//check the value
public boolean checkdata(){
boolean flag=true;
if(username.equals(""))
{
flag=false;
}
if(password.equals(""))
{
flag=false;
}
if(password.equals("")||password.length()>10||password.length()
-------------------
package login;
public class Check
{
public String username;
public String password;
public String email;
public Check() {
username="";
password="";
email="";
}
//get value
public String getUsername(){
return username;
}
public String getPassword(){
return password;
}
public String getEmail(){
return email;
}
//set value
public void setUsername(String usernamestr){
username=usernamestr;
}
public void setPassword(String passwordstr){
password=passwordstr;
}
//check the value
public boolean checkdata(){
boolean flag=true;
if(username.equals(""))
{
flag=false;
}
if(password.equals(""))
{
flag=false;
}
if(password.equals("")||password.length()>10||password.length()