public class User{ private String username; private String userpassword; public boolean check() { if(username == ? & userpassword == ?) return true; else return false; }}MD好久没写代码了,直接打的,也不知道有没有细节性的错误,你试试看吧