Question: O 2 ( 2 8 ) : Write the output. public class Shape f int hight; int width; String color: public Shape ( int hight,
O: 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.colorcolor;
f
Shapeint hieht, int width f
this, hight hight;
thiswidth width;
public int calcArea
return hight"width;
public string tostring
if this instanceof Rectangle
return "Color:" color area:"calcArea;
return "Widthhight:widthhight
area:"calcArea;
End of Shape class
class Rectangle extends Shapef
public Rectangle int int string c
super ;
public boolean check Object o
if this return true;
If null getClassgetclass
return false;
Rectangle Rectangle o;
End of Rectangle class
Write the output here
Q In the following table, write the appropriate term in front of each description.
Aadaki tabloda her tanmn yanna uygun terimi yazn trdrparent object.
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
