Basic HTML version of Foils prepared 19 July 97

Foil 9 Java Language -- Expressions

From Java Tutorial - Summer 1997 Part II: Java Language and Object-Oriented Concepts CEWES Tutorial -- July 22-25 1997. by Nancy J. McCracken,Geoffrey C. Fox


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 /* conditional expression */
8 "fred" + "jim" is "fredjim"
9 /* + Equivalent to . in Perl */
10 (a instanceof B) /* True iff object a is of class B */

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Wed Apr 1 1998