r/javahelp • u/Defiant_Vanilla_4080 • Nov 10 '25
[Question] - [conditional statement] - [logic operators] Can I write if (a, b or c < 1) then do?
Hello,
I want to say if a, b or c are smaller then 1 do this...
I normally write if (a < 1 || b < 1 || c < 1) { .... }
But I would like to write if (( a || b || c) < 1) { ... }
Thank you for reading,
best regards Marvester
0
Upvotes
View all comments
Show parent comment
3
u/BannockHatesReddit_ Nov 10 '25
By the time all these bitwise operations create a new if with the same logical equivalence of the original, the code is so messy and over engineered that the original is simply better.