The method printShapeInfo() is undefined for the type TwoDimensionalShape
TwoDimensionalShape []Shapes=new TwoDimensionalShape[]{r1,t1,c1};
ShapeDetector sd =new ShapeDetector();
for(TwoDimensionalShape t:Shapes)
{
if (t instanceof Rectangle) {
sd.detectShape((Rectangle) t);
((Rectangle) t).printShapeInfo();
}
if (t instanceof Circular) {
sd.detectShape((Circular) t);
((Circular) t).printShapeInfo();
}
if (t instanceof Triangle) {
sd.detectShape((Triangle) t);
((Triangle) t).printShapeInfo();
}
System.out.println("Area=" + t.getArea());
System.out.println("Circumference=" + t.getCircumference()+"\n");
}