public class Fisher {
public static int LIMIT = 10; // max # of fish that can be caught
private int numThingsCaught = 0;
public int getNumThingsCaught() { return numThingsCaught; }
}
This is my second class
public class Fish {
public boolean isDesirableTo(Fisher f) {
if (Fisher.getNumThingsCaught() < Fisher.LIMIT)
return true;
return false;
}
}
I am using eclipse and Fisher.getNumThingsCaught() is underlined, when i hover over to see the error the message says: "Cannot make a static reference to the non-static method getNumThingsCaught() from the type Fisher" How can I change my code in my !//Fish//! class to make this code work?