Question: In Java please. Create a Shape class as a parent class. Give Shape a variable for number of sides. It should have a constructor, a
In Java please. Create a Shape class as a parent class. Give Shape a variable for number of sides. It should have a constructor, a getter, and a setter. Use your Circle and Rectangle class from the previous HW as subclasses of Shape. Show how you would use Shape's variable in Circle and Rectangle via the keyword super. In main, show that a Circle object can use the Shape classes getter method to return the number of sides.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
