Constructor and Description |
---|
Circle()
Construct a Circle object using the default size for its radius.
|
Circle(Circle x)
This is the copy constructor.
|
Circle(double theRadius)
Construct a Circle object using the argument for the radius.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Returns true if and only if the argument is not null and is a Circle object that
has the same radius as this Circle.
|
double |
getPerimeter()
Get the perimeter of this Circle, (2*radius*pi).
|
double |
getRadius()
Get the radius of this Circle.
|
double |
getSurfaceArea()
Get the surface area of this Circle.
|
void |
setRadius(double theRadius)
Set the radius of this Circle.
|
java.lang.String |
toString()
Returns a String object representing this Circle's value.
|
getShapeName
public Circle()
public Circle(double theRadius)
theRadius
- the radius of this Circle; must be > 0public Circle(Circle x)
x
- is the Circle to be duplicated.public double getSurfaceArea()
getSurfaceArea
in class Shape
public double getPerimeter()
getPerimeter
in class Shape
public double getRadius()
public void setRadius(double theRadius)
theRadius
- the new radius of this Circle;
must be > 0public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- is the object to be compared with.