I'm trying to make an abstract Object Factory and I tryied a few things and none of them worked.
What I would like to have is something like this that could be overrided:
public abstract ObjectFactory {
public abstract Obj createObject (Type t) ;
}
that I could extends ObjectFactory and have:
public AntFactory extends ObjectFactory {
@Override
public Ant createObject(AntType t) { }
}
but everything I tryied did not override the createObject method. The only thing that worked for me was:
public abstract ObjectFactory {
public abstract Obj createObject (Type t) ;
}
Theres something that I'm not understanding about this concept or it doesn't work for enum.
Is there a way to keep the extends of enum only in the method and still override it?
No comments:
Post a Comment