Advertisements
Advertisements
Question
Explain the following with one example.
Ternary operator
Answer in Brief
Solution
Ternary operators handle three operands. Conditional assignment refers to assigning values to variables based on logical expressions.
Example: Syntax:
variable = (test expression) ? Expression 1 : Expression2
shaalaa.com
Is there an error in this question or solution?
Chapter 1.04: Operators in Java - EXERCISES [Page 44]