Question: This is lab3 .. i need the answer to be in ((java)) language & Object Oriented Programming 14011102-4 Lab#3 Consider the inheritance hierarchy in this

This is lab3 .. i need the answer to be in ((java)) language  This is lab3 .. i need the answer to be in
&
((java)) language & Object Oriented Programming 14011102-4 Lab#3 Consider the inheritance hierarchy

Object Oriented Programming 14011102-4 Lab#3 Consider the inheritance hierarchy in this figure Rectangle Shape Triangle Write a Java program that has three classes: Shape, Rectangle and Triangle. A Shape should have o o o a height, width, area of type double A default constructor A constructor that will take two parameters and assign them to data members o a set and a get method for all fields. Then, create two more classes Rectangle and Triangle that inherit the class Shape, where both classes should: Override the method getArea0 to return a double value represents the area of that shape. o o Add the method toString to print an object. Finally Test your classes with a TestShape class. Create two objects one from the type Rectangle and the other from the type Triangle. You should test your objects by filling the needed information and calling the two available methods

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!