title: How can I make the following object?
body: <p>I am new in java. So , I am trying to make asteroid game project.I have this point class</p>
  
  <pre><code>  class Point implements Cloneable {
       double x,y;
       public Point(double inX, double inY) { x = inX; y = inY; }
  
    public Point clone() {
        return new Point(x, y);
     }
     }
  </code></pre>
  
  <p>and the polygon class which takes an array of points,point and integer.
       class Polygon {
          private Point[] shape;   // An array of points.
          public Point position;   // The offset mentioned above.
          public double rotation; // Zero degrees is due east.</p>
  
  <pre><code>       public Polygon(Point[] inShape, Point inPosition, double inRotation) {
             shape = inShape;
             position = inPosition;
             rotation = inRotation;
  
      // First, we find the shape's top-most left-most boundary, its origin.
      Point origin = shape[0].clone();
          for (Point p : shape) {
          if (p.x &lt; origin.x) origin.x = p.x;
          if (p.y &lt; origin.y) origin.y = p.y;
      }
  
        // Then, we orient all of its points relative to the real origin.
      for (Point p : shape) {
         p.x -= origin.x;
        p.y -= origin.y;
      }
      }
  </code></pre>
  
  <p>.....
  .....
  ....
  in the main asteroid class . I want to make a polygon which is my ship. How can i put the parameter here?</p>
  
  <pre><code>public static void main (String[] args) {
          Asteroids a = new Asteroids();
          a.repaint();
  </code></pre>
  
  <p>I want to create an object of polygon
  I tried like this </p>
  
  <pre><code>       Polygon p=new polygon({(0,2),(2,3),(3,1)},(2,3),3);
  
             p.repaint();
  </code></pre>
  
  <p>I am not taking the parameter correctly.
  Any help will be appreciated.</p>