In my program there are only two classes one is Parent ,which is an abstract class and having a non static concrete method, void show(), now there is another class, Child which extends the abstract class, Parent and override the show() method. So now is there any way to access the method of abstract class from main method of Child class with out calling another non static method of Child class.
Share
This is what you’re looking for:
although that’ll only work from within a (non-static) member function of the subclass.
There’s no direct way to call an overridden method from another class. Your only option would be to have the subclass expose a new method that does nothing but call the parent’s overridden method.
However if you do need to do that it suggests that your class hierarchy is incorrectly designed…