Question: class Rectangle extends Shape { private double width; private doubld length; public Rectangle ( ) { this.width = 0 ; this.height = 0 ; }
class Rectangle extends Shape
private double width;
private doubld length;
public Rectangle
this.width;
this.height;
public RectangleString color,boolean filled,double width,double length
supercolorfilled;
this.widthwidth;
this.lengthlength;
@Override
double getArea
return widthlength;
@Override
double getPerimeter
return widthlength;
@Override
public String toString
return "Rectanglewidth width height height ;
public boolean equalsRectangle obj
if this obj
return true;
if obj null
return false;
if getClass obj.getClass
return false;
Rectangle other Rectangle obj;
if filled other.filled
return false;
if color null
if othercolor null
return false;
else if color.equalsothercolor
return false;
return true;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
