我想要以下设置:
abstract class Parent {
public static String ACONSTANT; // I'd use abstract here if it was allowed
// Other stuff follows
}
class Child extends Parent {
public static String ACONSTANT = "some value";
// etc
}
这在java中可能吗?如何?如果可以避免的话,我宁愿不使用实例变量/方法。
谢谢!
编辑:
常量是数据库表的名称。每个子对象都是一个迷你 ORM。