我希望有以下设置:
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。