The contents of both of the following if blocks should be executed:
if( booleanFunction() || otherBooleanFunction() ) {...}
if( booleanFunction() | otherBool
for programmers, there is only one difference.
booleanFunction() || otherBooleanFunction() will be true if either is true. likewise, booleanFunction() && otherBooleanFunction() will be false if either is false. So, why test the other one. that's what logical operators do.
But bitwise ones check both. A frequent application of this concept is as follows.
if(someObject != null && someObject.somemethod())
So, in this case if you replace && by & then wait for a disaster. You will get nasty NullPointerException soon...