Class Rectangle
java.lang.Object
Shape
Polygon
Rectangle
public class Rectangle
extends Polygon
-
Constructor Summary
Constructors Constructor Description Rectangle(java.lang.Integer... sides)
Create a new rectangle -
Method Summary
Modifier and Type Method Description double
calculateArea()
Calculate area of rectangleboolean
isSquare()
-
Constructor Details
-
Rectangle
public Rectangle(java.lang.Integer... sides)Create a new rectangle- Parameters:
sides
- sides of rectangle
-
-
Method Details
-
calculateArea
public double calculateArea()Calculate area of rectangle- Specified by:
calculateArea
in classShape
- Returns:
- area of Shape
-
isSquare
public boolean isSquare()- Returns:
- returns true if shape be square
-