Question: please help me with this JAVA question asap Consider the following Rectangle class: public class Rectangle { public int width, height; Add an instance method
please help me with this JAVA question asap

Consider the following Rectangle class: public class Rectangle \{ public int width, height; Add an instance method named compareTo that when passed another Rectangle object, returns - 1 if the width of the calling object is more than the width of the parameter object, - 1 if the width of the calling object is less than the width of the parameter object, - 0 otherwise
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
