I have a superclass Shape and many subclasses: Sphere, Cube, Cylinder, etc... Each of these subclasses extends Shape with a function called printData().
I cannot figure out how to call printData(). The compiler seems to be looking into Shape.java for the printData() method, whearas it should have been looking in the subclass for it.
Shape shapes = new Shape;
shapes = new Sphere();
shapes = new Cube();
shapes = new Cylinder();
main.java:89: cannot find symbol
symbol : method printData()
location: class Shape