The contents of both of the following if blocks should be executed:
if( booleanFunction() || otherBooleanFunction() ) {...}
if( booleanFunction() | otherBool
if( booleanFunction() || otherBooleanFunction() ) {...}
In this condition if booleanFunction()
returns true
then otherBooleanFunction()
would not be executed.
if( booleanFunction() | otherBooleanFunction() ) {...}
But in bitwise operator both functions - booleanFunction()
and otherBooleanFunction()
would be executed no matter booleanFunction()
returns true
or false