Computer Applications
The output of the statement:
System.out.println(Character.toUpperCase('b') + 2); is:
- 66
- 100
- 68
- 98
Java Library Classes
5 Likes
Answer
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.
Answered By
2 Likes
Related Questions
What is the output of the statement
Math.pow(36, 6/5);?- 36.0
- 1.0
- 73.71
- 6.0
Read the if program segment given below:
if(a > b) z = 25; else z = 35;Which one of the following is the correct conversion of the if program segment to ternary?
- z = a > b ? 35 : 25;
- z = a > b ? 25 : 35;
- z = a > b : 35 ? 25;
- z = a > b : 25 ? 35;
Consider the following statements:
Computer desktop = new Computer(); Computer Mainframe = new Computer();Name the objects of the class given above:
- Desktop, Mainframe
- desktop, Mainframe
- Computer, Mainframe
- Computer, desktop
The earth spins on its axis completing one rotation in a day. The earth revolves around the sun in 365 days to complete one revolution. What is the Java concept depicted in the given picture?

- Array
- Condition
- Nested loop
- While loop