It says that because if your conditional statement evaluates to false
then there will be no return statement, your code would just skip over it.
Use this template instead:
if(a==b && b==c){
return "Equilateral";
}
else{
return "Not Equilateral!";
}
You should use some curly braces, it will help make sense of what you're doing and prevents errors like yours.
Alternatively, if you'd prefer having a single return statement:
String result = "Not Equilateral";
if(a==b && b==c){
result = "Equilateral";
}
return result;
Edit following OP's clarification:
If you set your code like this, then if your triangle is not equilateral, the returned String will be empty (nothing will be printed with System.out.print()).
String result = "";
if(a==b && b==c){
result = "Equilateral";
}
return result;