Question: Reimplement the LabeledPoint class of Exercise E15.15 by storing the location in a java.awt.Point object. Your hashCode and equals methods should call the hashCode and
Reimplement the LabeledPoint class of Exercise E15.15 by storing the location in a java.awt.Point object. Your hashCode and equals methods should call the hashCode and equals methods of the Point class.
Data from Exercise E15.15
A labeled point has x- and y-coordinates and a string label. Provide a class LabeledPoint with a constructor LabeledPoint(int x, int y, String label) and hashCode and equals methods. Two labeled points are considered the same when they have the same location and label.
Step by Step Solution
3.28 Rating (151 Votes )
There are 3 Steps involved in it
ANSWER public class LabeledPoint private javaawtPoint location private String label ... View full answer
Get step-by-step solutions from verified subject matter experts
