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 circledouble
calculatePerimeter()
Calculate perimeter of circleboolean
equals(java.lang.Object obj)
int
getRadius()
Get radius of circleint
hashCode()
java.lang.String
toString()
-
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 classShape
-
equals
public boolean equals(java.lang.Object obj)- Specified by:
equals
in classShape
-
getRadius
public int getRadius()Get radius of circle- Returns:
- radius of circle
-
toString
public java.lang.String toString()- Overrides:
toString
in classShape
-
calculatePerimeter
public double calculatePerimeter()Calculate perimeter of circle- Specified by:
calculatePerimeter
in classShape
- Returns:
- perimeter of Shape
-
calculateArea
public double calculateArea()Calculate area of circle- Specified by:
calculateArea
in classShape
- Returns:
- area of Shape
-