Escolar Documentos
Profissional Documentos
Cultura Documentos
Operators can be
binary
unary ternary
involving 2 operands
involving 1 operand involving 3 operands
2+3
-3 follows
Ternary Operator
a Ternary operator is an operator that takes three arguments. The arguments and result can be of different types. Since this operator is often the only existing ternary operator in the language, it is referred as "the ternary operator", though it is more accurately referred to as the conditional operator.
ternary operator is also referred as conditional operator because: It is only operator that has three operands. It is a shorthand of combination of the if-else and return statement.
MEANING If Expression1 is true, then the value of the entire expression is Expression2. Otherwise, the value of the entire expression is Expression 3.
FOR EXAMPLE . . .
min = ( x < y ) ? x : y ;