I am going through SCJP 6 book by Kathy and Bret and came across some text from this book, chapter 4 (operators)
Because you know by now that Java is not C++, you won't be surprised that Java operators aren't typically overloaded. There are, however, a few exceptional operators that come overloaded:
- The + operator can be used to add two numeric primitives together, or to perform a concatenation operation if either operand is a String.
- The &, |, and ^ operators can all be used in two different ways, although as of this version of the exam, their bit-twiddling capabilities won't be tested.
I am failing to understand the second use of &, | and ^ operators in java other than bitwise AND, OR and XOR respectively. What are the two different ways of using & operator in java?