Beginner Question: Class Capabilities
I missed a few lectures in class and I got very behind. My assignment is to:
Can someone guide me in the right direction? Can you show me how to set up the first part? I am very thankful for any help I get.
Create a base class named "Rectangle" that contains length and width data members. From this class, derive a class named "Box" having an additional data memner named "depth". The method members of the base "Rectangle" class should consist of a constructor and an override method named "area()" method. The derived "Box" class should have a constructor and an override method named "area()" that retuns the surface area od the box and a "volume()" method.
Include in the classes constructed for the previous exercise in a working Java program. Have yoru program call all of the member methods in each class and explain the result when the area method is called using the two "box" objects.