Home / Questions / What will be the output of the following code? char x = 'A'; int m; m = (x == 'a') ? 'A' : 'a'; System.out.println("m = " + m);
Explanatory Question

What will be the output of the following code?

char x = 'A'; 
int m; m = (x == 'a') ? 'A' : 'a'; 
System.out.println("m = " + m); 

👁 77 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

Output: m = 97 (Since the ASCII value of 'a' is 97)