import java.io.*;
public class FoundStaff {
private String staId;
private String staName;
private String staSex;
private String staUserName;
private String staPassWord;
public void Staffer(String Id, String Name, String Sex, String UserName,
String PassWord) {
staId = Id;
staName = Name;
staSex = Sex;
staUserName = UserName;
staPassWord = PassWord;
}
public String getStaId() {
return staId;
}
public void setStaId(String staId) {
this.staId = staId;
}
public String getStaname() {
return staName;
}
public void setStaname(String staname) {
this.staName = staname;
}
public String getStaPassWord() {
return staPassWord;
}
public void setStaPassWord(String staPassWord) {
this.staPassWord = staPassWord;
}
public String getStaSex() {
return staSex;
}
public void setStaSex(String staSex) {
this.staSex = staSex;
}
public String getStaUserName() {
return staUserName;
}
public void setStaUserName(String staUserName) {
this.staUserName = staUserName;
}
/**
* @param args
*/
public static void main(String[] args)
throws IOException{
// TODO 自动生成方法存根
FoundStaff[] staff = new FoundStaff[3];
staff[0]=new FoundStaff();
staff[0].Staffer("1000","luyihua","男","zhongguo" ,"123456");
staff[1] =new FoundStaff();
staff[1].Staffer("1001","luyihua","男","zhongguo" ,"123456");
staff[2]=new FoundStaff();
staff[2].Staffer("1003","luyihua","男","zhongguo" ,"123456");
System.out.println("请输入要查询的学号:");
BufferedReader br = new BufferedReader(new InputStreamReader(
System.in));
String num = br.readLine();
for(int i = 0; i < 3 ; i ++ ){
if(staff[i].getStaId() == num){
System.out.println(staff[i].getStaId()+" "+staff[i].getStaname());
}else{
System.out.println("无此工号!");
}
}
}
}
怎么不能查询呀???