You might find this more effective.
Define your parent class with a method getName. Note that this can be public, if you want your model class to expose a Name property, otherwise, you can keep it as "protected" as I have here. "Protected" will keep the method visible within this class, and any derived (child) classes.
public class Model { private static String MODEL_NAME = "Model"; protected String getModelName(){ return MODEL_NAME; } }
Then define an "override" for the name method on your child class:
public class EventModel extends Model { private static String MODEL_NAME = "events"; @Override // Tells the compiler that this method OVERRIDES the parent method public String getModelName(){ return MODEL_NAME; } }
This compiles and runs the way I suspect you are trying to acheive . . .
EDIT: Oooh. NOW I see the problem. Missed that you needed to reference that from a static method . . .