Conditional Operator (?:)
Ternary operator:
condition ? expr1 : expr2
First operand is condition.
If condition is true, take value of expr1; otherwise, take value of expr2.
Previous slide
Next slide
Back to first slide
View graphic version