title: Java -how can I make class Oval using the start point for their centre and control point for the edges of the shape?
body: <p>As a Beginner in Java i have tried to write the following Oval class. I know there is error and so needed assistance in correcting.</p>
  
  <pre><code>public class Oval extends Shapes {
        private int upperLeftX;
        private int upperLeftY;
        private int width;
        private int height;
  
  
       public  Oval(Point startPoint){
          super( startPoint);
  }
      @Override
      public void draw(Graphics g) {
          int upperLeftX = Math.min(startPoint.x, controlPoint.x );
          int upperLeftY = Math.min(startPoint.y, controlPoint.y );
          int width = Math.abs(startPoint.x- controlPoint.x);
         int height = Math.abs(startPoint.y- controlPoint.y);
  
          g.setColor(getColour());   
          g.drawOval(upperLeftX, upperLeftY, width, height);
      }
  
  }
  </code></pre>
  
  <p>Over here all what I am trying to do is use the start point for their centre and control point for the edges of the shape.</p>