Now we know that multiplying an int by an int gives another int, or adding two ints gives an int and so on. That's because these operations which are associated with the type int have a return value of int. That's right -- you can think of * or + or - or / as being a method which takes two parameters, and returns a value. (We've been looking at things the other way up until now, thinking of the methods of a class as being analagous to the operations on an int, but thinking of the operations as methods is equally instructive).
For example, let's say that the Java language used the method multiply() to multiply two integers.
Then the declaration might look something like this:
public static int multiply(int a, int b){ return a*b; }
This is in some sense what the '*' symbol represents: a method which takes 2 integers as arguments and returns an integer. There is a different method (but the same symbol) for arguments of type double and so on. (If you think about it, the methods for int and double have to be different - a variable of type int has a different encoding than a variable of type double).
At any rate, there are other 'methods' for numeric types, and these 'methods' return a value of type boolean. Namely these 'methods' or operators are
You can think of these as 'methods' that take two expressions of type int, for example, and return a value of type boolean. (The same holds for expressions of type double. Recall that when expressions involve both a double and an int, the int is promoted to a double and then the expression is evaluated. The same is true here when a variable of type int is compared to a variable of type double using one of the relational operators above.)
For example:
Recall that the possible values of an expression of type value are true and false. The list above shows what the expressions on the left evaluate to: either true or false.
Of course, we don't have to limit ourselves to comparing values to other values; we can compare the values stored in variables in the obvious way i > j, or we can comare the results of complicated mathematical expressions such as 4*i +7j + i*j == i+ 2*j - 3.
Of course, it's not absolutely clear how to evaluate this mathematical expression. For example, how do we now which operation to do first? For the answer to this, we have to look at operator precedence. By ranking the operators, we can decide which operation should be performed first: the operation with the higher-ranked operator should be performed first. See page 102 and the chart on page 145 of Nino and Hosch for a discussion of this.