问题:我是否正确制作了这个UML图?
UML图表:
环
+ PI:double
+ setRadius(rad:double):void
代码:
public class Circle
{
//Declaration
private double radius;
public static final double PI = 3.14159;
public Circle()
{
radius = 0.0;
}
public Circle(double rad)
{
radius = rad;
}
/**
The setRadius method stores a value in the
radius field.
@param rad The value to store in radius.
*/
public void setRadius(double rad)
{
radius = rad;
}
/**
The getRadius method returns a Radius
for the Circle.
@return The entered radius in the radius field.
*/
public double getRadius(double rad)
{
return radius;
}
/**
The getArea method returns an Area
for the Circle.
@return The Area for the Circle.
*/
public double getArea()
{
return PI * (radius * radius);
}
/**
The getDiameter method returns a diameter
for the Circle.
@return The diameter for the Circle.
*/