java.lang.Comparable<Shape>
public class Triangle extends Shape
Constructor | Description |
---|---|
Triangle(Point a,
Point b,
Point c) |
Initializes a newly created Triangle object.
|
Modifier and Type | Method | Description |
---|---|---|
double |
calculateArea() |
Calculate the area of the triangle.
|
double |
calculatePerimeter() |
Calculate the perimeter of the triangle.
|
boolean |
equals(java.lang.Object o) |
Compares this triangle to a specified object.
|
double |
getSide1() |
The length of the first side of the triangle.
|
double |
getSide2() |
The length of the second side of the triangle.
|
double |
getSide3() |
The length of the third side of the triangle.
|
int |
hashCode() |
hashCode autogenerated using IntelliJ.
|
public double getSide1()
public double getSide2()
public double getSide3()
public double calculateArea()
calculateArea
in class Shape
public double calculatePerimeter()
calculatePerimeter
in class Shape
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object to compare the triangle againstpublic int hashCode()
hashCode
in class java.lang.Object