What are the parts called?
>
, &&
, and ==
are all operators. Operands are the values passed to the operators. x
, y
, and z
are the initial operands. Once x > y
and z == 5
are evaluated, those boolean results are used as the operands to the &&
operator which means the expressions themselves are not the operands to &&
, the results of evaluation those expressions are the operands.
When you put operands and an operator together, you get an expression (i.e. x > y
, z == 5
, boolResult == boolResult
)
How are they evaluated?
In most (if not all) languages x > y
will be evaluated first.
In languages that support short circuiting, evaluation will stop if x > y
is false. Otherwise, z == 5
is next.
Again, in languages that support short circuiting, evaluation will stop if z == 5
is false. Otherwise, the &&
will come last.
>
, &&
, and ==
are all operators. Operands are the values passed to the operators. x
, y
, and z
are the initial operands. Once x > y
and z == 5
are evaluated, those boolean results are used as the operands to the &&
operator.