Normally, I would have to type something like
if(a == x || b == x) {...}
But I saw that when using try/catch blocks, you can do stuff like this:
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch(ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {}
Is there something similar I can do with equality statements, like
if((a | b) == x) {...}
?
No. The least you can do is ||
. Other than multi catch block, operator |
gets treated as bitwise OR and that is not what you needed. Inshort NO.
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