1(vii)
The output of the statement:
System.out.println(Character.toUpperCase('b') + 2); is:
- (a)66
- (b)100
- (c)68
- (d)98
Show SolutionHide Solution↓
68
Reason — The method Character.toUpperCase('b') converts 'b' to 'B'. In Java, when a character is used in an arithmetic expression, it is converted to its ASCII (Unicode) value. The ASCII value of 'B' is 66, and adding 2 gives 66 + 2 = 68. Hence, the output is 68.