KnowledgeBoat Logo

Output Questions for Class 10 ICSE Computer Applications

Predict the output of the below Java program snippet:

int x = 90;  
char c = (x<=90)?'Z':'I';

Java

Java Operators

ICSE

21 Likes

Answer

Z

Working

As value of x is 90 so condition of ternary operator is true. Variable c is assigned the value of expression 1 which is Z.

Answered By

10 Likes