使用Java检查变量是否在两个数字之间 [英] Check if a variable is between two numbers with Java
本文介绍了使用Java检查变量是否在两个数字之间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对此代码有疑问:
if (90 >>= angle =<< 180)
错误说明是:
作业的左侧必须是变量。
The left-hand side of an assignment must be a variable.
我明白这意味着什么但是如何将上述代码转换为正确的代码?
I understand what this means but how do I turn the above code into correct code?
推荐答案
我在代码中看到一些错误。
你可能意味着数学术语
I see some errors in your code.
Your probably meant the mathematical term
90< = angle< = 180,意味着角度在90-180范围内。
90 <= angle <= 180, meaning angle in range 90-180.
if (angle >= 90 && angle <= 180) {
// do action
}
这篇关于使用Java检查变量是否在两个数字之间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文