I have a question about the meaning (evaluation) of Boolean variables in return statements in Java.
I know that:
if (var) { ... }
i
It's not an "implicit assumption," it's what the compiler's doing. The b < a
is just an expression, the same as if it were used for an if
statement. The expression evaluates to a boolean
, which is then returned.
Also noteworthy, you seem to interchange boolean
and Boolean
as though they're the same, but they're actually not. boolean
is the primitive form while Boolean
is an Object that wraps a boolean
.