
reference.language.ternary.html Maven / Gradle / Ivy
Ternary expressions
Ternary expressions
Ternary expressions are expressions used to provide alternate values depending on a logical expression.
A ternary expression is a code fragment which produces a value, which can then be used as an input for other operations: print, write, method call and so forth.
A ternary expression has the form:
condition ? value-if-true : value-if-false
in O dialect
value-if-true if condition else value-if-false
in M and E dialects
where condition
is a boolean expression and value-if-true
and value-if-false
are expressions with compatible types.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy