In last project we created an abstract class Shape then a Point class that extends Shape, and then, a class for Square,

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

In last project we created an abstract class Shape then a Point class that extends Shape, and then, a class for Square,

Post by answerhappygod »

In last project we created an abstract class Shape then a Point
class that extends Shape, and then, a class for Square, that
extends Point (a Square 'is-a' point with 2 sides), and lastly, a
Cube class that extends Square (a Cub 'is-a' Square with a depth).
Okay so now, we have a shape hierarchy. Shape (abstract) Point
(extended) Square (extended) Cub (extended) To these, for this
project, you need to add some more shapes These are: Circle, &
Cylinder. So we will have: Cylinder (extended) Circle (extended)
Shape (abstract) Point (extended) Square (extended) Cub (extended)
I will provide you with a driver that creates one of each shapes,
adds them to an array of Shapes, and then prints out everything we
know about each one. After that it creates an array of type Shape
and assign all of the above shapes to be an element of the array.
Then lastly, in a for loop print-out all known information about
each element of the array. For the last part we are treating /
handling each as type Shape.
*Make your own class Shape*
Square.java
Point.java
Cube.java
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply