public class Triangle { private int a, b, c; public Triangle(int a, int b, int c) { this.a = a; this.b = b; this.c = c; } public boolean estIsocele() { return (a == b || a == c || c == b); } public boolean estEquilateral() { return (a == b && b == c); } public boolean estRectangle() { double ac = Math.pow(a, 2); double bc = Math.pow(b, 2); double cc = Math.pow(c, 2); return ( (ac + bc == cc) || (ac + cc == bc) || (bc + cc == ac) ); } public boolean estScalen() { return (! estRectangle() && ! estIsocele()); } public double surface() { double p = (a + b + c) / 2.0; double surf = Math.sqrt(p * (p - a) * (p - b) * (p - c)); return surf; } }