ternary operators in java examples Example: ternary operator java variable = (condition/expression1) ? expression2 if true : expression3 if false