1 | To test if two things are equal, for most types: |
2 | Other tests for int and double types: |
3 | To test if two strings have the same value: |
4 | int num; |
5 | if ( num == 0 ) ... value of num is 0 |
6 | ( num != 0 ) value of num is not 0 |
7 | ( num < 0 ) value of num is less than 0 |
8 | ( num <= 0 ) value of num is less than or = 0 |
9 | ( num > 0 ) value of num is greater than 0 |
10 | . . . and so on |
11 | String label; |
12 | if ( label.equals ("enter") ) value of label is "enter" |