Question: ***IN JAVA*** 1)Write an abstract class Shape Data members: numSides Constructor: initialize numSides Concrete method: get method for numSides Abstract methods: getArea(), getPerimeter() 2) Write

***IN JAVA***

1)Write an abstract class Shape

Data members: numSides

Constructor: initialize numSides

Concrete method: get method for numSides

Abstract methods: getArea(), getPerimeter()

2) Write a concrete subclass Rectangle

Data members: width, height

3) Write a concrete subclass RtTriangle

Data members: width, height

4) In another class, write a main method to define a Rectangle and a Triangle.

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!