Advertisement
Mr_Linnenburger

Shapes Interface

Dec 11th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. public interface Shape
  2. {
  3.     //calculates and returns the area of the shape
  4.     public abstract double getArea();    
  5.  
  6.     //calculates and returns the perimeter of the shape
  7.     public abstract double getPerimeter();
  8.  
  9.     //returns true if the area of the current shape is bigger than the
  10.     //area of the otherShape, otherwise returns false.
  11.     public abstract boolean hasBiggerArea(Shape otherShape);
  12.  
  13.     //returns true if the perimeter of the current shape is bigger than
  14.     //the perimeter of the otherShape, otherwise returns false.
  15.     public abstract boolean hasBiggerPerimeter(Shape otherShape);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement