Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This assignment helps you understand Inheritance. We want to create a superclass or parent class called Shape. This shape class will have just one method
This assignment helps you understand Inheritance. We want to create a superclass or parent class called Shape. This shape class will have just one method to setBorderColor. Now we need 3 subclasses that extend the Shape class, Circle, Square and Rectangle. In these classes we will need to compute the area of each of the shapes and print it to the console using System.out.println You will need to take in an additional parameter in each of these subclasses -- side for Square, length and breadth for rectangle and radius for the circle. Finally create a new class called App. You will need to have a main method in this App class that will construct the different shapes and call the computeArea method of each of the shapes to print out the area and call the getBorderColor to print out the border color of each shape.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started