Question: 6.1 Learning Objective: To demonstrate that the student can implement the java.lang.Comparable interface. Instructions: For this exercise you wll be modifying the Point class declaration


6.1 Learning Objective: To demonstrate that the student can implement the java.lang.Comparable interface. Instructions: For this exercise you wll be modifying the Point class declaration which was discussed in the Week 1 lecture notes in Objects and Classes : Section 1 (in burger-cse205-note-objs-classes-01.pdf). The Point.java source code file can be found in the Week 1 Source Code zip archive). Include Point.java in your assignment zip archive. Problem: Consider the Point class mentioned in the Instructions. Modify this class so it implements the java.lang. Comparables: Point> interface. We define Point pl to be less than Point p2 if the distance from the origin to pl is less than the distance from the origin to p2; p1 is greater than p2 if the distance from the origin to pl is greater than the distance from the origin to p2; otherwise, if the distances are equal then pl is equal to p2 Testing: We will be testing your method using our driver routine. For testing on your end, write your own driver rou- tine in a class different than Point
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
