<分区>
public class lookFor {
//Tools
//It returns the position of an element at the ArrayList, if not found returns -1
public int User(String target, ArrayList<User> users){
for(int i = 0; i < users.size(); i++){
if(users.get(i).getUserName().equals(target)){
return i;
}
}
return -1;
}
}
出于某种原因,当我尝试调用“用户”时 This Error appears
并要求我将“user”方法设为静态方法,但我不知道它会产生什么影响。