Overview Schedule Announcements Resources Assignments Home

CSC 121: Computer Science I, Spring 2005

In-Class Exercise: Arrays of Points

Arrays of Points

Goals:
To prepare for project 4: Mouse events, arrays of Points.
Getting started:
The Steps of the Lab:
  1. Become familiar with the Point class.
    Read

    Go to BlueJ help and click on Java Class Libraries. This will take you to a web site that has interface information about each Java class. Locate the Point class and complete the following:

    • What fields are defined in the class? What types are they? What does it mean as far as access is concerned that these fields are public rather than private?
    • Become familiar with the Point class methods. Note that you probably will not have to use getX() or getY().
    Do

    Open the Driver class. Replace all references to Circle with Point so that you have an array of points rather than circles (you may still call the Point array "myCircle" if you wish).

    Modify the mouse event methods to collect in the Point array the same information originally collected in the Circle array.

Overview Schedule Announcements Resources Assignments Home

Valid HTML 4.01!Valid CSS!DePauw University , Computer Science Department , Spring 2005
Maintained by Brian Howard ( bhoward@depauw.edu ). Last updated