title: Creating a Circle Class in Java with Point center?
body: <p>Write a class encapsulating the concept of a circle, assuming a circle has the following attributes: a Point representing the center of the circle, and the radius of the circle, an integer. Include a constructor, the accessors and mutators, and methods toString and equals. Also include methods returning the perimeter (2*PI*radius) and area (PI*radius^2) of the circle.</p>
  
  <pre><code>import java.awt.*;
  
  
  public class Circle {
  
      private int radius;
  
      public Circle() {
  
          radius = 1;
      }
  
      public Circle(int x, int y, int r) {
          super(x, y, c);
          radius = r;
      }
  
      public int getRadius() {
          return radius;
      }
  
      public double getArea() {
          return Math.PI * radius * radius;
      }
  
      public double getPerimeter() {
          return 2 * Math.PI * radius;
      }
  }
  </code></pre>
  
  <p>I could get this far, I'm just a little confused on the adding the point constructor, accessor and mutator to my class. </p>
  
  <p>Would it look something like this?</p>
  
  <pre><code>  protected int x, y;
  
    public point() {
  
        setPoint(0,0);
  
    }
  
    public point(int coordx, int coordy) {
        setPoint(coordx,coordy);
    }
  
    public void setPoint(int coordx, int coordy) {
        x = coordx;
        y = coordy;
    }
    public int getX() {
        return x;
    }
  
    public int getY() {
        return y;
    }
  
    public String toPrint() {
        return "[" + x + "," + y + "]";
    }
  
    }
  </code></pre>
  
  <p>Is it possible to combine the both in 1 Class? I tried it and every line in it had an error saying Circle had no return type. Any insight would be a returnable favor. Thanks again guys.</p>