import java.util.Arrays;

public class PointMainWithArrays {
  public static void main(String args[]) {
    int []iA = new int[3];
    String []sA = new String[3];
    
    Point []pArray = new Point[3];

    pArray[0] = new Point(0,0);
    pArray[1] = new Point(10,20);
    pArray[2] = new Point(5,5);

    /* could also write like this */
    // Point []pArray = {
    //   new Point(0,0),
    //   new Point(10,20),
    //   new Point(5,5)
    // };

    // System.out.println(pArray[1]);
    // pArray[0].setX(5);
    // System.out.println(pArray[0]);
    
    // System.out.println("before:");
    // for (int i = 0; i < pArray.length; i++) {
    //   System.out.println(pArray[i]);
    // }

    System.out.println(Arrays.toString(pArray));
    
    // /* if we wanted to move just one
    //  * Point, the syntax is: */
    // Point p = new Point(5, 5);
    // p.move(1,1);

    /* everyone moves over 1 to the right */
    for (int i=0; i < pArray.length; i++) {
      pArray[i].move(1,0);
    }
    
    System.out.println("after:");
    for (int i = 0; i<pArray.length; i++) {
      System.out.println(pArray[i]);
    }
  }
}
