title: program using class point class circle java
body: <p>Create class Point which has two private members: int x and int y, representing point's coordinates. Class Point has two constructors:</p>
  
  <ol>
  <li>Point() that assigns zeros to variables x and y, and</li>
  <li>Point(int x, int y) that assigns values x and y to variables this.x and this.y, respectively.</li>
  </ol>
  
  <p>Also, write a member method public void move(int x, int y) which assigns values x and y to private members and override method public String toString() which returns String representation of a Point (x + " " + y).</p>
  
  <p>Create class Circle which has two private members: int radius and Point center. Write the following counstructors:</p>
  
  <ol>
  <li>Circle() - assume that default radius is 1 and center (0,0)</li>
  <li>Circle(int radius) - that assigns integer radius to this.radius (center at 0,0)</li>
  <li>Circle(Point center) - that assigns point center to this.center (radius 1)</li>
  <li>Circle(int radius, Point center) - that assigns integer radius to this.radius and point center to this.center</li>
  </ol>
  
  <p>Also, write the following member methods:</p>
  
  <ol>
  <li>double area() - which computes the circle's area</li>
  <li>double circumference() - which computes the circle's circumference</li>
  <li>String toString() - which returns String representation of circle's radius and center.</li>
  </ol>
  
  <p>Write a driver class Lab2.java which instantiates several objects of type Point and Circle (at least 4, using 4 different constructors) and tests all your member methods. </p>
  
  <pre><code>class Point {
  
      private int x; 
      private int y;
  
      public Point(){
          x = y = 0; 
      }
  
      public Point(int x, int y){
          this.x = x; 
          this.y = y; 
      }
  
      public void move (int x, int y){
          this.x = x; 
          this.y = y; 
      }
  
      public String toString(){
          String s = "x: " + x + "y: " + y; 
          return s; 
      }
  }
  
  class Circle{
      private int radius; 
      private Point center; 
  
      public Circle(){
          int radius = 1; 
          Point center = new Point(0,0);
      }
  
      public Circle(int radius){ 
          int radius = this.radius(center(0,0));  
      }
  
      public Circle(Point center){ 
          Point center = this.center(radius (1));   
      } 
  
      public Circle(int radius, Point center){
          int radius = this.radius; 
          Point center = this.center; 
      }
  
      double area() {
          return Math.PI*radius*radius; 
      }
  
      double circumference(){
          return 2*Math.PI*radius; 
      }
  
      String toString( ){
          String s = "radius: " + radius + "center: " + center; 
          return s; 
      }
  }
  
  class Lab21{ 
      public static void main(String[] args){
          Circle c = new Circle (); 
          System.out.println(c); 
          c.move(4,2); 
          System.out.println(c); 
          c.resize(5,2); 
          System.out.println(c); 
  
          point center = new Point(3,3); 
          Circle s = new Circle (6, 1, center); 
          System.out.println(s); 
      }
  }
  </code></pre>
  
  <p>These are the errors I'm currently getting: </p>
  
  <pre><code>Lab21.java:37: error: variable radius is already defined in constructor Circle(int)
      int radius = this.radius(center(0,0));  
          ^
  Lab21.java:37: error: cannot find symbol
      int radius = this.radius(center(0,0));  
                               ^
    symbol:   method center(int,int)
    location: class Circle
  Lab21.java:41: error: variable center is already defined in constructor Circle(Point)
      Point center = this.center(radius (1));   
            ^
  Lab21.java:41: error: cannot find symbol
      Point center = this.center(radius (1));   
                                 ^
    symbol:   method radius(int)
    location: class Circle
  Lab21.java:45: error: variable radius is already defined in constructor Circle(int,Point)
      int radius = this.radius; 
          ^
  Lab21.java:46: error: variable center is already defined in constructor Circle(int,Point)
      Point center = this.center; 
            ^
  Lab21.java:57: error: toString() in Circle cannot override toString() in Object
  String toString(){
         ^
    attempting to assign weaker access privileges; was public
  Lab21.java:67: error: cannot find symbol
      r.move(4,2); 
      ^
    symbol:   variable r
    location: class Lab21
  Lab21.java:69: error: cannot find symbol
      r.resize(5,2); 
      ^
    symbol:   variable r
    location: class Lab21
  Lab21.java:72: error: cannot find symbol
      point center = new Point(3,3); 
      ^
    symbol:   class point
    location: class Lab21
  </code></pre>