Question: . Create a base class named Rectangle that contains length L and width W double instance variables. The methods of the Rectangle class should consist

. Create a base class named Rectangle that contains length L and width W double instance variables. The methods of the Rectangle class should consist of 1. a constructor that initialize both L and W to 0, 2. a setDimensions method that set L and W to the appropriate passed parameters, and 3 area method returning L'W for the area. 2. From the base class, derive a class named Box having an additional instance variable height H. The derived Box class should have a constructor that initialize L, W and H to zero. and must override the area method to calculate the surface area of the box and a method named volume to return the volume of the box
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
