CSE 341 -- S. Tanimoto
Java Classes and Inheritance
5
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.