having a problem with a program im working on with inheritance. suppose to output the area, perimeter, and area i think i have it all set up correctly but its not out putting correctly here is the the superclass that inherites to the client form.
public class CIRCLE extends CLIENT
{
public double radius;
public double perimeter;
public double area;
public CIRCLE(double newRadius, double newPerimeter, double newArea)
{
setRADIUS(newRadius);
setPERIMETER(newPerimeter);
setAREA(newArea);
}
public double getRadius()
{
return radius;
}
public double getPerimeter()
{
return perimeter;
}
public double getArea()
{
return area;
}
public void setRADIUS(double newRadius)
{
newRadius = radius;
}
public void setPERIMETER(double newPerimeter)
{
newPerimeter = 2 * Math.PI * radius;
}
public void setAREA(double newArea)
{
newArea = Math.PI * Math.pow(radius,2);
}
}
And here is my CLient...
public class CLIENT
{
public static void main(String[] args)
{
System.out.println("--------------------");
CIRCLE cTotal = new CIRCLE (5.0,7.0,2.0);
System.out.println("Circle = " + cTotal);
}
}
the output i am getting dosent make since
here it is :
.6.0_30 <Default> - <Default>--------------------
Circle = CIRCLE@addbf1
Process completed.
What is wrong?