Example of Polymorphism
public
class Cylinder extends Circle
private double height;
…constructor, set/get values…
//override getArea
public double getArea()
return 2 * super.getArea() + getCircumference() getHeight();
//override getVolume
public double getVolume()
return super.getArea() * getHeight() }
//override getName
public String getName()
return “Cylinder”;
}