public class Circle
extends java.lang.Object
Constructor and Description |
---|
Circle()
Construct a default circle
|
Circle(double radius)
Construct a circle with the specified radius
|
Modifier and Type | Method and Description |
---|---|
double |
getArea()
Return area
|
double |
getRadius()
Return the radius
|
void |
setRadius(double radius)
Set a new radius
|
public Circle()
public Circle(double radius)
radius
- the radius of the circlepublic double getRadius()
public void setRadius(double radius)
radius
- a new radiusjava.lang.IllegalArgumentException
- if the radius is negativepublic double getArea()