Hi,
This Q is from TIJ 4e, Interfaces, Ex-4
It is like this
Create an abstract class with no methods. Derive a class and add a method. Create a static method that takes a reference to the base class, downcasts it to the derived class and calls the method. In main(), demonstrate that it works. Now put the abstract declaration for the method in the base class, thus eliminating the need for the downcast.
How providing a abstract declaration for a method in base class will eliminate the need to downcast ??\
So i tried it with the following code
It still requires downcast. i checked the errara of this 4e.
But there is nothing regarding this.
Please clarify over this.