Computer Applications
int x = 98; char ch = (char)x; what is the value in ch?
- b
- A
- B
- 97
Values & Data Types Java
ICSE 2024
9 Likes
Answer
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'.
Answered By
7 Likes
Related Questions
Consider the below picture and choose the correct statement from the following:
- Polygon is the object and the pictures are classes
- Both polygon and the pictures are classes
- Polygon is the class and the pictures are objects
- Both polygon and the pictures are objects
The output of the statement "CONCENTRATION".indexOf('T') is:
- 9
- 7
- 6
- (-1)
The access specifier that gives least accessibility is:
- package
- public
- protected
- private
The output of the statement "talent".compareTo("genius") is:
- 11
- ā11
- 0
- 13