MCQ
Single Best Answer
Easy
QSystem.out.println('Z'+32); will display:
ID: #24150
ICSE Computer Application - Class X - 2025 PYQ
144 views
Question Info
#24150Q ID
EasyDifficulty
ICSE Computer Application - Class X - 2025 PYQTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer: Option D
Explanation
The correct answer is:
(d) 154
Explanation:
In the expression:
System.out.println('Z' + 32);
-
The character
'Z'has an ASCII value of 90. -
The integer 32 is added to it:
90 + 32 = 122. -
Since both
'Z'(char) and32(int) are involved in an arithmetic operation,'Z'is promoted to an integer before addition. -
The result is 122, which is the ASCII value of
'z', but since no type casting is done, it prints the integer 122 instead of the character'z'.
So, the correct answer should be (c) 122, not (d) 154. Please verify your answer choices.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic