So I have the following array list:
ArrayList <Employee> employees = new ArrayList<>();
In my main method I create instances of them
public static void main(String[] args){
Employee test = new Manager("john doe", 1000); //manager is subclass
}
I have a method that checks that the employee object doesn't already exist, the equals method is defined in the subclasses
public void addEmployee(Employee newEmployee){
for (int i = 0; i < employees.size(); i++){
if(newEmployee.equals(employees.get(i))){
.........
}
}
}
Theres more to it above, but you get the point. I need to reference the ArrayList, but if I instantiate the array list outside of the main method I can't add any variables to it, getting the error "non-static method cannot be referenced from static context" which makes sense, but I don't know how to use that method then since I can't declare it in the main method.

staticvariable. What's the issue?