public final class Circle
extends Shape
Constructor and Description |
---|
Circle()
Constructor passes default values to Circle(int, int) constructor.
|
Circle(int x,
int y,
int radius)
Constructor sets radius of the circle and passes the point where it
will draw to the Shape superclass constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
draw()
Prints the radius of the circle to the terminal window.
|
int |
getRadius()
Returns the radius of the circle.
|
void |
setRadius(int radius)
Sets the radius of the circle which must be greater than zero (0)
or equal to zero if null (default).
|
public Circle()
public Circle(int x, int y, int radius)
x
- the x-coordinate where the circle drawsy
- the y-coordinate where the circle drawsradius
- the radius of the circlepublic void draw()
draw
in class Shape
public int getRadius()
public void setRadius(int radius)
radius
- the radius of the circle