Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

International Baccalaureate Computer Science HL And SL Option A Databases Part I Basic Concepts

Authors: H Sarah Shakibi PhD

1st Edition

1542457084, 978-1542457088

More Books

Students also viewed these Databases questions