I was just wondering how can get the NOR operator in Java like this
if (!(foo == "bar" || foo1=="bar1")){
...
}
Edit : I was looking for a more efficient way to write that
[...] I was looking for a more efficient way to write that
There is no NOR operator in Java. You have to do it as you've done
!(A || B)
or, !A && !B
of course.
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