Missing return statement making triangle program

后端 未结 4 600
花落未央
花落未央 2021-01-27 09:24
public String displayType(int side1, int side2,int side3)
    {
        if(( side1+side2 > side3))

            if(( side1==side2) && (side2==side3))//tell if         


        
4条回答
  •  甜味超标
    2021-01-27 09:34

    As the final logic (in your case) will always be true, you do not need the final else if

    simply

    return ("Scalene Triangle."); 
    

    But what will happen if the below if false?

    if(( side1+side2 > side3))
    

    You need to return something.

提交回复
热议问题