Question: You've been given 3 java classes: Shape, Circle, and Rectangle. Abstract classes can be used in instances where it doesn't make sense to create objects
You've been given java classes: Shape, Circle, and Rectangle.
Abstract classes can be used in instances where it doesn't make sense to create objects of that specific type. For instance, in this example, Rectangles and Circles are types of Shapes, but there isn't such a thing as a Shape that isn't also a more specific type of Shape.
Start by making the Shape class abstract and then try running your code.
Fix the code so that the variable type remains the same, but is being instantiated with either of the child class types, and move on to problem
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
