What would be the most terse way in Java to check for the following condition
int m, n;
The condition to check is whether either m or n are negative but both shouldn't be negative. I'm looking for a terse yet simple syntax
(m < 0) ^ (n < 0)
Note that in this context, ^
is the logical XOR operator (yes, I do mean "logical", distinct from "bitwise").
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With