public class Cubic extends Rectangle { protected int z; protected int length; public Cubic() { super(); } public Cubic(int x, int y, int z, int length, int width, int height) { super(x, y, width, height); this.z = z; this.length = length; } public void setZ(int z) { this.z = z; } public void setLength(int length) { this.length = length; } public int getZ() { return z; } public int getLength() { return length; } public int getVolumn() { // å¯ä»¥ç´æ¥ä½¿ç¨ç¶é¡å¥ä¸çwidthãheightæå¡ return length*width*height; } }