Question: comparable which contains two methods and calPerimeter (2) (8 points)Define a class named Rectangle which implements MyComparable. a) Declare two instance variables width and height.
comparable which contains two methods and calPerimeter (2) (8 points)Define a class named Rectangle which implements MyComparable. a) Declare two instance variables width and height. b) Define setter and getter methods for width and height c) A default constructor d) A constructor with arguments for width and height. e) Override the method named calArea, which returns the area of the rectangle f) Override the method named calPerimeter() which retums the perimeter of the rectangle comparable which contains two methods and calPerimeter (2) (8 points)Define a class named Rectangle which implements MyComparable. a) Declare two instance variables width and height. b) Define setter and getter methods for width and height c) A default constructor d) A constructor with arguments for width and height. e) Override the method named calArea, which returns the area of the rectangle f) Override the method named calPerimeter() which retums the perimeter of the rectangle
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
