Most voted "short-circuit" questions
3 questions
Sort by count of
-
25
votes4
answers4422
viewsWhat is the difference between & and &&operators?
I was making a simple code with a if two conditions. Everything worked normal and after I went to read, I realized I had written condicao & condicao2 instead of using &&. Even with this…
-
19
votes2
answers2430
viewsUsing && e || instead of "if" and "Else"
Lately I’ve seen some codes that use && and || to replace if and else , and even to do checks with less code. I’m using this technique quite smoothly so far. Follow an example code: const…
-
4
votes1
answer278
viewsInterpretation of logic operators in Java regarding short-circuit
I read that question Doubt about logical operators && e || in Java, but I follow with the doubt. Solving some exercises on Java I find such a statement: Operators & and | operate in the…