Umm.. that's not right... in Java (and C/C++ if I remember correctly) the single "|" and "&" are bit-wise operators, not logical operators, they are used for completely different things.
You use the "&&" and "||" for boolean statements:
true && true = true
true && falase = false
false && false = false
true || true = true
true || false = true
false || false = false
You use the "&" and "|" for bit operations, given the following are binary numbers:
1010 & 0101 = 0000
1010 & 1000 = 1000
1010 | 0101 = 1111
1010 | 0000 = 1111
You use the "&&" and "||" for boolean statements:
true && true = true
true && falase = false
false && false = false
true || true = true
true || false = true
false || false = false
You use the "&" and "|" for bit operations, given the following are binary numbers:
1010 & 0101 = 0000
1010 & 1000 = 1000
1010 | 0101 = 1111
1010 | 0000 = 1111