type=page
status=published
title=Operators
next=jsf-el006.html
prev=jsf-el004.html
~~~~~~
Operators
=========

[[BNAIK]]

[[operators]]
Operators
---------

In addition to the `.` and `[]` operators discussed in
link:jsf-el003.html#BNAHU[Value and Method Expressions], the EL provides
the following operators, which can be used in rvalue expressions only.

* Arithmetic: `+`, `-` (binary), `*`, `/` and `div`, `%` and `mod`, `-`
(unary).
* String concatenation: `+=`.
* Logical: `and`, `&&`, `or`, `||`, `not`, `!`.
* Relational: `==`, `eq`, `!=`, `ne`, `<`, `lt`, `>`, `gt`, `<=`, `ge`,
`>=`, `le`. Comparisons can be made against other values or against
Boolean, string, integer, or floating-point literals.
* Empty: The `empty` operator is a prefix operation that can be used to
determine whether a value is `null` or empty.
* Conditional: `A ? B : C`. Evaluate `B` or `C`, depending on the result
of the evaluation of `A`.
* Lambda expression: `->`, the arrow token.
* Assignment: `=`.
* Semicolon: `;`.

The precedence of operators, highest to lowest, left to right, is as
follows:

* `[] .`
* `()` (used to change the precedence of operators)
* `-` (unary) `not ! empty`
* `* / div % mod`
* `+ -` (binary)
* `+=`
* `<> <= >= lt gt le ge`
* `== != eq ne`
* `&& and`
* `|| or`
* `? :`
* `->`
* `=`
* `;`


