Constructor and Description |
---|
Cube()
Initializes the height of this cube to zero.
|
Cube(int height)
Initializes this cube with the given height.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object)
Tests if this cube is the same as the given object, that is,
the object is an instance of this class and has the same side
as this cube.
|
double |
getArea()
Returns the area of this cube.
|
int |
getHeight()
Returns the height of this square.
|
static Cube |
getRandom()
Returns a random cube.
|
double |
getVolume()
Returns the volume of this cube.
|
String |
toString()
Returns a string representation of this cube.
|
public Cube(int height)
height
- the height of this cube.public Cube()
public static Cube getRandom()
public int getHeight()
public double getArea()
public double getVolume()
public boolean equals(Object object)