Conditional Operator « Operators « SCJP
Java Source And Data Type
The conditional operator ?: (a ternary operator)
The ternary operator ? : has three operands and takes the following form: operand1 ? operand2 : operand3
a = x ? b : c; The types b and c should be compatible.
a = x ? b : c; The type of the expression x should be boolean.
nest conditional operators into one statement
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.