Expressions and Operators

Expressions and Operators

Operators enable us to perform an evaluation or computation on a data object or objects.
Operators applied to variables and literals form expressions.

An expression can be thought of as a programmatic equation. Therefore, an expression is a sequence of one or more data objects (operands) and zero or more operators that produce a result.

An example of an expression follows:
x = y / 3;

In this expression, x and y are variables, 3 is a literal, and = and / are operators.

This expression states that the y variable is divided by 3 using the division
operator (/), and the result is stored in x using the assignment operator (=).

Here the expression is described from right to left.

Scroll to Top