how to use greater than and less than in a single if statement in java

后端 未结 2 835
庸人自扰
庸人自扰 2021-01-22 17:04

I have made a BMI calculator from programming by doing, one of the thing i have to do is add categories using if statements. 18.5 to 24.9 normal weight so that would be one of t

2条回答
  •  长情又很酷
    2021-01-22 17:47

    Use

    if ( bmi > 18.5 && bmi < 24.9)
    

    Unfortunately, Java does not support a 'BETWEEN' operator (like what SQL does e.g).

提交回复
热议问题