/* * Kyle Pierce * CSE 143 * * Client program showing arrays of objects in Java. In this case, * we are looking at an array of points. */ import java.awt.*; // to import the Point class public class PointArray { public static void main(String[] args) { // the following constructs the array, but no Point objects Point[] points = new Point[5]; // this loop fills up the array with Point objects for (int i = 0; i < points.length; i++) { points[i] = new Point(i, i); } // this loop prints the Point objects for (Point p : points) { System.out.println(p); } } }