Abstract class - access to parent
807588May 30 2009 — edited May 30 2009Hi:
I would like to do the following, but I don´t know how (neither if its possible):
Access from an abstract class a method of its implementer class.
public class ContainerClass () implements AbstractClass{
public void AbstractMethod(){
super().Method1();
}
}
public abstract class AbstractClass(){
public void Method1(){
parent.AbstractMethod();
parent.getClassName(); // I am expecting ContainerClass
}
public void AbstractMethod();
}
The method Method1 will be the same for every class implementing AbstractClass, but dependent of the implementation of the AbstractMethod in the container class.
Theoretically, the ContainerClass object should have all the methods implemented in runtime, therefore, all of them accessible in the same object.
Does anybody know how to do this?
Cheers!