Java Reference
In-Depth Information
Assignment Operator
The assignment operator can be applied to expressions, and it assigns the rvalue to the lvalue.
an lvalue refers to the value or expression on the left side of the = sign, and the rvalue refers to the value
or expression on the right side of the = sign. if the lvalue is not writable, then a PropertyNotWriteableException will
be thrown.
In the case of X = Y , X would be assigned the value of Y . If there are more than one equal signs present in an
expression, then when read from left to right, the first equal sign divides the lvalue and rvalue. All remaining equal
signs are part of the rvalue. For instance, the parentheses in the following example surround the rvalue:
y = (a = z -x * 10)
The ELResolver.setValue method determines how assignment is made. If an assignment is illegal in a given
circumstance, then the ELResolver.setValue method will not make the assignment. In a stand-alone environment,
the ELResolver is part of a class named the StandardELContext . If an assignment is made to an identifier that has
not yet been declared, then a new bean is created in the local bean repository, and it is named the same as the newly
specified identifier.
Semicolon Operator
The semicolon operator (;) is used to return from an expression. The semicolon operator is much like the semicolon
in Java, whereas it is used to end a statement or expression. Therefore, if there were more than one expression on the
same line and the expressions were separated by semicolons, then the first expression would be evaluated, followed
by the second, and so on. After each expression is evaluated, it is discarded, and the next expression is evaluated
Precedence Changes
Operator precedence can become important if more than one operator exists in the same expression. It is important
to understand which operator will be evaluated first so that the correct expression will be evaluated first. Table 3-3
lists each of the operators that are part of EL, from highest precedence to lowest precedence, given that an expression
is evaluated from left to right. If more than one operator has the same precedence, then each of those operators will be
listed in the same table line.
Search WWH ::

Custom Search