JAVA

Conditional Ternary Operator

A conditional operator is a ternary (3 - operand) operator.

Syntax

booleanExpr ? true : false
Depending on the Boolean Expression, it evaluates and returns the value of trueExpr or falseExpe.

Example

(Marks >= 35) ? Pass : Fail;



Subscribe us on Youtube

Share This Page on


Ask Question