Whenever the "&&" operator is used, such as in:
exp1 && exp2
where exp1 and exp2 are boolean expressions, both the boolean expressions are not always evaluated.
If the first expression is false, the result of the "&&" operation will always be false regardless of the second expression. The "&" operator on the other hand forces the evaluation of the second expression even if the first expression is false.
consider the statement "x = (a > b) ? a : b"; then the value of x is 27, if a = 18 and b = 27.
the statement is equivalent to: if (a > b) x = a; else x = b;
The operations y >> 3 and y >>> 3 produce the same result when y > 0.
The shift operation "y1 >>> y2" is identical to "y1 >> y2" for all positive values of y1. It shifts the bits in y1 to the right by y2 positions.
All bitwise operations are carried out with the same level of precedence in Java.
All operations in Java, including the bitwise operations, are carried out with a definite precedence.
Declarations must appear at the start of the body of a Java method.
They can appear anywhere within the body of the method.