English

Explain the following with one example. Ternary operator - Computer Applications

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]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 1.04 Operators in Java
EXERCISES | Q V. 3. (d) | Page 44
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×