Class Circle

java.lang.Object
Shape
Circle

public class Circle
extends Shape
  • Constructor Summary

    Constructors 
    Constructor Description
    Circle​(int radius)
    Create a new Circle
  • Method Summary

    Modifier and Type Method Description
    double calculateArea()
    Calculate area of circle
    double calculatePerimeter()
    Calculate perimeter of circle
    boolean equals​(java.lang.Object obj)  
    int getRadius()
    Get radius of circle
    int hashCode()  
    java.lang.String toString()  

    Methods inherited from class Shape

    draw

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Circle

      public Circle​(int radius)
      Create a new Circle
      Parameters:
      radius - radius of circle
  • Method Details

    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class Shape
    • equals

      public boolean equals​(java.lang.Object obj)
      Specified by:
      equals in class Shape
    • getRadius

      public int getRadius()
      Get radius of circle
      Returns:
      radius of circle
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class Shape
    • calculatePerimeter

      public double calculatePerimeter()
      Calculate perimeter of circle
      Specified by:
      calculatePerimeter in class Shape
      Returns:
      perimeter of Shape
    • calculateArea

      public double calculateArea()
      Calculate area of circle
      Specified by:
      calculateArea in class Shape
      Returns:
      area of Shape