|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectShape
Circle
public class Circle
A Circle is a Shape that maintains information about its radius. A Circle knows how to return its radius, set its radius, calculate and return its area, and calculate and return its circumference.
Field Summary | |
---|---|
private double |
myRadius
|
Constructor Summary | |
---|---|
Circle(double x)
Constructs a circle with initial radius specified by x. |
Method Summary | |
---|---|
double |
findArea()
Calculates and returns the circle's area. |
double |
findCircumference()
Calculates and returns the circle's circumference. |
double |
getRadius()
Returns the circle's radius |
void |
setRadius(double x)
Sets the radius to the input number. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private double myRadius
Constructor Detail |
---|
public Circle(double x)
x
- initial radiusMethod Detail |
---|
public double getRadius()
public void setRadius(double x)
x
- assigns x to myRadiuspublic double findArea()
findArea
in class Shape
public double findCircumference()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |