Class InvertedTriangle
java.lang.Object
InvertedTriangle
public class InvertedTriangle
- extends Object
This class describes inverted triangle objects that can be displayed
using asterisks and new lines
Constructor Summary |
InvertedTriangle(int aWidth)
Constructs an inverted triangle. |
Method Summary |
String |
toString()
Computes a string representing the inverted triangle. |
InvertedTriangle
public InvertedTriangle(int aWidth)
- Constructs an inverted triangle.
- Parameters:
aWidth
- the number of * in the first row of the triangle.
toString
public String toString()
- Computes a string representing the inverted triangle.
- Overrides:
toString
in class Object
- Returns:
- a string consisting of * and newline characters