public String displayType(int side1, int side2,int side3)
{
if(( side1+side2 > side3))
if(( side1==side2) && (side2==side3))//tell if
Try this
public String displayType(int side1, int side2,int side3)
{
if(( side1+side2 > side3)){
if(( side1==side2) && (side2==side3))//tell if equalateral
{
return "Equalateral Triangle.";
}
else if (( side1==side2) & (side2 != side3) || (side1 == side3) & (side3 != side1))//tells if isosceles
{
return "Isosceles Triangle.";
}
else if ((side1 != side2) & (side2 != side3))//tells if scalene
{
return "Scalene Triangle.";
}
}
else{
return "Not a triangle";
}
}