Class Cube
public class Cube extends
RectangularParallelopiped{
// A constructor that calls its parent constructor:
Cube(double side) {
super(side, side, side);
}
}
// Cube inherits the volume() method of its parent.
Previous slide
Next slide
Back to first slide
View graphic version