Java Reference
In-Depth Information
The value obtained when an expression is evaluated is called the result.
Complex expressions are formed using operators.
Operator
A special symbol (like + or * ) that is used to indicate an operation to be
performed on one or more values.
The values used in the expression are called operands. For example, consider the
following simple expressions:
3 + 29
4 * 5
The operators here are the + and * , and the operands are simple numbers.
3
+
29
operand
operator
operand
4
*
5
operand
operator
operand
When you form complex expressions, these simpler expressions can in turn
become operands for other operators. For example, the expression
(3 + 29) - (4 * 5)
has two levels of operators.
(3
+
29)
-
(4
*
5)
operand
operator
operand
operand
operator
operand
operand
operand
operator
The addition operator has simple operands of 3 and 29 and the multiplication
operator has simple operands of 4 and 5 , but the subtraction operator has operands
that are each parenthesized expressions with operators of their own. Thus, complex
expressions can be built from smaller expressions. At the lowest level, you have
simple numbers. These are used as operands to make more complex expressions,
which in turn can be used as operands in even more complex expressions.
 
 
Search WWH ::




Custom Search