if else statement error as it says its not a statement

后端 未结 5 1671
渐次进展
渐次进展 2021-01-29 14:05

I am new to java programming and I am trying to program, however, I am getting an error in my If Else statement. Can someone please look into it and help me.

 pu         


        
5条回答
  •  滥情空心
    2021-01-29 15:01

    Please use else if (condn). In java if you use single else then it means none of the above conditions got satisfied but else is never followed by a condition unless you use else-if.

    ie.

    ..
    else if (value < mYellowStep)
    return effort.WALKING;
    }
    
    simply use
    ..
    else
     return effort.WALKING
    }
    

提交回复
热议问题