Java's expressions are very similar to C and the following are valid: |
2+3 |
(2+3)*i |
i++ /* equivalent to i = i +1 */ |
(i > 0 ) && (j>0) /* Boolean */ |
i <<1 /* Left shift by 1 binary digit */ |
(i>0) ? true:false /* conditional expression */ |
i >>> 2 /* Signed right shift by 2 binary digits */ |
"fred" + "jim" is "fredjim" |
/* + Equivalent to . in Perl */ |
(a instanceof B) /* True iff object a is of class B */ |