Hello. I'm working on a java assignment for school and I keep getting this one error message. My teacher gave us an abstract class that includes two abstract methods and a HashSet. We have to extend the abstract class and define these methods. When I try a command like: HashSet.add(new apple()) or HashSet.size() in one of the methods I am defning, I get these errors: non-static method add(java.lang.Object) cannot be referenced from a static context non-static method size() cannot be referenced from a static context Does anyone know what's going on?
Joined: Jun 20, 2002
Oh nevermind. I misread a variable name. All fixed now.
subject: non-static method add(java.lang.Object) cannot be referenced from a static context