您的位置:首页 > 其它

Cannot use this in a static context

2013-01-14 17:26 197 查看
public class User implements Serializable{
public static final String FILENAME = "users.dat";
private String user_name;
private String user_psw;
public String getUser_name() {
return user_name;
}
public void setUser_name(String user_name) {
this.user_name = user_name;
}
public String getUser_psw() {
return user_psw;
}
public void setUser_psw(String user_psw) {
this.user_psw = user_psw;
}
public static ArrayList<User> getAllUsers(){
DataInputStream dis;
try {
dis = new DataInputStream(new FileInputStream(User.FILENAME));// 这里写this.FILENAME是不对的
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
……
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐