Point myPoints[];
myPoints = new Point[2];
myPoints[0] = new Point();
myPoints[1] = new Point(150, 200);
for (i = 0; i < myPoints.length; i++)
System.out.println("Point " (i + 1) + " is " + myPoints[i]);
Note that it uses myPoints.length in the for loop - why is it valid for this code?