Question: O 2 ( 2 8 ) : Write the output. public class Shape f int hight; int width; String color: public Shape ( int hight,

O2(28): Write the output.
public class Shape f
int hight;
int width;
String color:
public Shape (int hight, Int width, String color)(
this. hight = hight;
this.width = width;
s
this.width = widt, this.color=color;
f
Shape(int hieht, int width) f
this, hight - hight;
}
this-width = width;
public int calcArea()f
return hight"width;
}
public string tostring()f
if (this instanceof Rectangle)
return "Color:"+ color+-, area:"+calcArea();
return "Width/hight:"+width+","+hight+
", area:"+calcArea();
}
3// End of Shape class
class Rectangle extends Shapef
public Rectangle (int h, int w, string c){
super (h,w,c);
public boolean check (Object o){
if (this =0) return true;
If null |1getClass(),1|=0.getclass()
return false;
Rectangle r=(Rectangle) o;
}
3// End of Rectangle class
Write the output here
Q3(24). In the following table, write the appropriate term in front of each description.
Aadaki tabloda her tanmn yanna uygun terimi yazn. trdr.parent object.
 O2(28): Write the output. public class Shape f int hight; int

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!