Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Cylinder extends Circle {
- double height;
- public Cylinder() {
- this.height = 1.0;
- }
- public Cylinder(double radius, String color, double height) {
- super(radius, color);
- this.height = height;
- }
- @Override
- public double getArea() {
- double area = 2 * Math.PI * radius * height + 2 * super.getArea();
- return area;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement