KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
When used with boolean operands, & and | become logical operators per Section 15.22.2 of the JLS . Unlike && and || , however, these don't short-circuit; they always evaluate both sides. I have a silly question: Why are the less-efficient non-short-circuit logical operators ( & , | ) still there, when we have the more-efficient short-circuit logical operators ( && , || )? I mean, what is the real usage of the non-short-circuit logical operators, as opposed to with the short-circuit logical operators? In other words, what is the usage of always evaluating both sides by using the non-short-circuit logical operators?
Tags (comma-separated)
Save Edits
Cancel