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(); } …… } }
相关文章推荐
- Cannot use this in a static context
- Cannot use this in a static context
- Cannot use this in a static context
- Cannot use this in a static context
- Use MFC in a Static Library,This may be due to a corruption of the heap....
- APP-SQLAP-10380:You cannot select this payment document because it is in use by another payment batch
- [转]How to use IHttpContextAccessor in static class to set cookies
- 虚拟机无法打开——显示Cannot open virtual machine:This virtual machine appears to be in use
- Cannot open virtual machine:This virtual machine appears to be in use
- non-static variable this cannot be referenced from a static context
- APP-SQLAP-10380: You cannot select this payment document because it is in use by another payment
- VMWare虚拟机显示Cannot open virtual machine:This virtual machine appears to be in use
- 我的Java开发学习之旅------>Workspace in use or cannot be created, choose a different one.--错误解决办法
- Workspace in use or cannot be created, choose a different one.--错误解决办法
- Workspace in use or cannot be created, choose a different one.--错误解决办法
- error C2440: 'static_cast' : cannot convert from 'void (__thiscall MenuToolBar::* )(LPARAM,LRESULT *)' to 'void (__thiscall CCmd
- vmware--This virtual machine is already in use
- 解决 js报错:Uncaught TypeError- Cannot use 'in' operator to search for 'length' in [{"id":"636","...
- office2013死活没法激活:Cannot Activate because this product is incapable of KMS Activation.
- This absolute uri http://java.sun.com/jsp/jstl/core) cannot be resolved in either web.xml or the ...