Answer:
public class Circle {
private double radius;
public Circle(double r)
{
radius = r;
}
public double getArea()
{
return Math.PI * radius * radius;
}
public double getRadius()
{
return radius;
}
public String toString()
{
String str;
str = "Radius: " + radius +
"Area: " + getArea();
return str;
}
public boolean equals(Circle c)
{
boolean status;
if(c.getRadius() == radius)
status = true;
else
status = false;
return status;
}
public boolean greaterThan(Circle c)
{
boolean status;
if(c.getArea() > getArea())
status = true;
else
status = false;
return status;
}
}
Step-by-step explanation:
There is nothing with the logic of your code it work fine the problem is with the structure of your code you added an extra curly brace before declaring (r)
****************************** Am talking about this section **********************
public class Circle {
{
private double radius;
**************************** It should be *******************************************
public class Circle {
private double radius;