Question: Please Help ASAP How to Submit Please submit your java source files (answers) to the iCollege 'assignment' drop box for your lab, once you have

 Please Help ASAP How to Submit Please submit your java source
Please Help ASAP

How to Submit Please submit your java source files (answers) to the iCollege 'assignment' drop box for your lab, once you have completed. Failure to submit within your given time period will result in a ZERO FOR THIS LAB. NO EXCEPTIONS 1. Write a class called Rectangle that implements the comparable interface. The class should contain three fields: height (int), width (int), topCorner (Point). Write the necessary constructors, accessors, mutators and other methods. The Point class is given below. 2. Write a client class, RectangleClient that creates an ArrayList of ten Rectangle objects called listi. a. Print the list. b. Call Collections.sort(listi), to sort the elements according to the height. If the height of any objects are equal, then sort the list using the width of the rectangle and if the width of any objects are equal, as well, then sort them using the topCorner point (hint: call the Point.compareTo() method). Print the sorted list from the main() method. public class Point implements Comparable { private int x; private int y public Point() { this (0, 0); public Point (int x, int y){ this.xx; this.yay; public int getX() { return x; 1 public int getY() return y } public String tostring) { return (" + x + ","+y+"); } public int compareTo (Point pt) if(this.x--pt.) return this.y-pt.y: else return this.x-pt

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!