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 rectangle
    boolean isSquare()  

    Methods inherited from class Polygon

    calculatePerimeter, equals, getSides, hashCode, toString

    Methods inherited from class Shape

    draw

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • 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 class Shape
      Returns:
      area of Shape
    • isSquare

      public boolean isSquare()
      Returns:
      returns true if shape be square