I have a superclass Shape and many subclasses: Sphere, Cube, Cylinder, etc… Each of these subclasses extends Shape with a function called printData().
Shape[] shapes = new Shape[3];
shapes[0] = new Sphere();
shapes[1] = new Cube();
shapes[2] = new Cylinder();
shapes[0].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.
main.java:89: cannot find symbol
symbol : method printData()
location: class Shape