What are ternary operators?
Advertisements
Question
What are ternary operators?
Short Answer
Advertisements
Solution
The Ternary Operator (?:) in Java is a conditional operator that operates on three operands. It is used to evaluate a condition and select one of two values based on whether the condition is true or false. It provides a shorter and simpler alternative to an if-else statement.
shaalaa.com
Is there an error in this question or solution?
Chapter 6: Variables and Expressions - EXERCISE [Page 131]
