Question: JAVA Define an abstract class called GeometricFigure with height and width attributes. Include an abstract method to calculate the surface area of the object. Define

JAVA
JAVA Define an abstract class called GeometricFigure with height and width attributes.

Define an abstract class called GeometricFigure with height and width attributes. Include an abstract method to calculate the surface area of the object. Define TWO (2) subclasses named Square and Triangle that inherit the abstract class GeometricFigure. Define all abstract methods accordingly. Define a Java interface called SizeComparable that contains an abstract method called comparesize(). This method will compare the surface area of two Geometric Figure objects and display whether the object surface area is smaller, larger or equal to the other object's surface area. Provide another class with the main () method to demonstrate the above concepts. (25 Mark)

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!