1(ii)
int x = 98; char ch = (char)x; what is the value in ch?
- (a)b
- (b)A
- (c)B
- (d)97
Show SolutionHide Solution↓
b
Reason — In Java, when an int value is cast to char, it is converted based on the ASCII code. Since, 98 is the ASCII code of the letter b, hence value of ch is 'b'.