Home » JAVA Programming » Basic Operators » Question
  1. What should be expression1 evaluate to in using ternary operator as in this line?

    expression1 ? expression2 : expression3
    1. Boolean
    2. Floating – point numbers
    3. Integer
    4. float
    5. None of these
Correct Option: C

The controlling condition of ternary operator must evaluate to boolean.



Your comments will be displayed only after manual approval.