Java Ternary without Assignment
Nope you cannot do that. The spec says so. The conditional operator has three operand expressions. ? appears between the first and second expressions, and : appears between the second and third expressions. The first expression must be of type boolean or Boolean, or a compile-time error occurs. It is a compile-time error for either … Read more