class Triangle (1 of 2)
import java.awt.*;
import java.util.*;
public class Triangle extends Polygon {
Triangle(Point p1, Point p2, Point p3) {
vertices = new Vector();
vertices.addElement(p1);
vertices.addElement(p2);
vertices.addElement(p3);
}
public String describe() {
if (isIsosceles()) return "an isosceles triangle";
else return "a triangle";
}
Previous slide
Next slide
Back to first slide
View graphic version