"J. Davidson said:
The term I learned for such operations is "bitwise logic", with
"arithmetic" referring to ordinary addition, multiplication, and
the like.
These issues are difficult to discuss without common terminology. For
this reason, Lew helpfully referred us to the relevant sections of the
JLS:
<
http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.22>
In section 15.22, it is clear that Bitwise and Logical Operators (&, |,
^) may be applied to numeric or boolean operands. As these operators
may be used to perform certain set or modular operations on numeric
arguments, the term "arithmetic operators" seems apt. As the operators
may also be applied to operands of type boolean, the term "logical
operators" makes sense in that context.
This article expands on the topic of bitwise operators in both arithmetic
and logical contexts:
In sections 15.23 and 15.24, it is clear that the Conditional operators
(&&, ||) apply only to results of type boolean and include a convenient
"short-circuit" feature, although that term is not used. Certainly the
conditional operators afford some efficiency, but one must be carful
not to optimize away the result.
My experience is that I hardly ever use, or even see, single | and &
used on booleans. This is what I meant in excluding them from my list of
what's "normally" used; normal as in what is statistically typical.
This is not my experience. You have adduced examples where the
conditional operator was optimal; similarly, a logical operator may be
correct when side-effects of evaluation are intended. Recalling that
most programming errors are logic errors, I would advocate using
whichever operator specifies the desired operation.
Apparently either your experience differs or you meant "normal" in the
sense of "permitted by the language specification".
I might have said "common", "usual," or "customary".