There is one more operator called conditional operator. This first evaluates an expression for a true or false value and then execute one of the two given statements depending upon the result of the evaluation. The conditional operator has this syntax −
Operator | Description | Example |
---|---|---|
? : | Conditional Expression | If Condition is true ? Then value X : Otherwise value Y |
All the operators we have discussed above can be categorised into following categories −