package shapes; import java.lang.*; /* This class provides a third dimension to Rectangle */ public class Box extends Rectangle { int height; // override the Rectangle height int depth; // unique to Box public Box() { height = 4; width = 3; // the width from Rectangle depth = 2; } public int getDepth() { return depth; } public void setDepth(int newDepth) { depth = newDepth; } // width is the same as super.width public int getVolume() { return height * width * depth; } }