Class Circle

java.lang.Object
  extended by Circle

public class Circle
extends java.lang.Object


Field Summary
private static int numberOfObjects
          The number of the objects created
private  double radius
          The radius of the circle
 
Constructor Summary
Circle()
          Construct a circle with radius 1
Circle(double newRadius)
          Construct a circle with a specified radius
 
Method Summary
 boolean equalRadius(Circle c)
          compare radius with that of circle c
static int getNumberOfObjects()
          Return numberOfObjects
 java.lang.String toString()
          Return string representation of circle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

radius

private double radius
The radius of the circle


numberOfObjects

private static int numberOfObjects
The number of the objects created

Constructor Detail

Circle

public Circle()
Construct a circle with radius 1


Circle

public Circle(double newRadius)
Construct a circle with a specified radius

Parameters:
newRadius - - double, the radius of the new Circle object
Method Detail

equalRadius

public boolean equalRadius(Circle c)
compare radius with that of circle c

Parameters:
c - the Circle object that the current Circle will be compared to
Returns:
boolean return result of "are the radii equal?"

getNumberOfObjects

public static int getNumberOfObjects()
Return numberOfObjects

Returns:
return value of static variable numberOfObjects

toString

public java.lang.String toString()
Return string representation of circle

Overrides:
toString in class java.lang.Object
Returns:
String value that is a representation of the circle