KnowledgeBoat Logo

Computer Applications

Predict the output of the below Java program snippet:

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

Java

Java Operators

ICSE

23 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

11 Likes


Related Questions