Boolean expressions in Java

后端 未结 8 1196
不知归路
不知归路 2020-12-21 06:00

I have a question about the meaning (evaluation) of Boolean variables in return statements in Java.

I know that:

if (var) { ... }

i

8条回答
  •  我在风中等你
    2020-12-21 06:38

    Don't needlessly complicate your code. If you feel the need to say "a < b == true", then you can follow that to its logical conflusion (conclusion + confusion) and say "((((((((...(a"

    "a < b" is a boolean expression. If you already have a boolean, why compare it to another boolean? You're not making it more boolean that way.

提交回复
热议问题