I cant figure out how to fix the "public class Triangle implements Measurable"
i dont know what i am doing wrong to get this error.. i am not fluent in java but i never had this error before. i tried changing the name but in the process i get more errors. if any one can help Thank you very much.
public class Triangle {
/** Sean Bing
*/
double side1 = 0;
double side2 = 0;
double side3 = 0;
double s = (side1 + side2 + side3) / 2;
double area = Math.sqrt (s * (s - side1) * (s - side2) * (s - side3));
public interface Measurable {
public double getPerimeter();
public double getArea();
}
public class Triangle implements Measurable // error at Triangle- can't have
// the same name as parent file
{
private double mySide1;
private double mySide2;
private double mySide3;
public Triangle(double Side1, double Side2, double Side3)
{
mySide1 = side1;
mySide2 = side2;
mySide3 = side3;
}
public double getPerimeter()
{
return s = (side1 + side2 + side3) / 2;
}
public double getArea()
{
return area = Math.sqrt(s * (s - side1) * (s - side2) * (s - side3));
}
public class RightTriangle extends Triangle {
public class RightTriangle {
}
}
}
}