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