public class Cuboid extends ThreeDShape { Rectangle rec; int depth; public Cuboid( Rectangle rec, int depth) { this.rec = rec; this.depth = depth; } public double getVolume() { return rec.getArea() * depth; } public double getArea() { return 2 * ( depth * rec.getWidth() + depth * rec.getHeight() + rec.getArea() ); } public String toString() { return rec.toString() + " ,depth: "+depth; } }