Basic HTML version of Foils prepared Feb 19 1999

Foil 16 More on conditions

From Computing and Java Language Basics NPAC Java Academy February--April 99 -- Feb 13 1999. by Nancy McCracken


To test if two things are equal, for most types:
Other tests for int and double types:
To test if two strings have the same value:
int num;
if ( num == 0 ) ... value of num is 0
( num != 0 ) value of num is not 0
( num < 0 ) value of num is less than 0
( num <= 0 ) value of num is less than or = 0
( num > 0 ) value of num is greater than 0
. . . and so on
String label;
if ( label.equals ("enter") ) value of label is "enter"



© 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 Mon Jul 5 1999