java初学求助!!
thinking in java第7章练习求救!!
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.
题目里的Create a static method that takes a reference to the base class是说要建立一个使用基础类对象作为参数的方法吧?但基础类是一个抽象的类,那就不能建立一个它的对象啊~那又如何来进行下溯造型呢??如果先把一个它的子类上溯为参数再来下溯的话,好像有点无聊...实在是不懂,请各位高人指教!!