Advertisement
Guest User

eitobhalo

a guest
Mar 30th, 2020
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. public class Cylinder extends Circle {
  2. double height;
  3.  
  4. public Cylinder() {
  5. this.height = 1.0;
  6. }
  7.  
  8. public Cylinder(double radius, String color, double height) {
  9. super(radius, color);
  10. this.height = height;
  11. }
  12.  
  13. @Override
  14. public double getArea() {
  15. double area = 2 * Math.PI * radius * height + 2 * super.getArea();
  16.  
  17. return area;
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement