CS 112a
Fall 2004
Ileana Streinu

4 Minute Quiz #7


  1. Write your name on a blank piece of paper.
  2. Write a simple Java class definition for a class smartPoint, which extends the class myPoint from today's lecture. In addition to the x and y coordinates and the shape and color, the smartPoint also retains an integer value, which acts as some sort of id number for the point.
  3. Write a simple constructor for smartPoint, which initializes all its class variables with values provided as parameters to the method.
  4. Override the method equals from the class Point, so that it tests equality of the x and y coordinates, as well as of the id number of a point.