KnowledgeBoat Logo

Output Questions for Class 10 ICSE Computer Applications

Find the output of the following program snippet:


char ch = 'y';
char chr = Character.toUpperCase(ch); 
int p = (int) chr;
System.out.println(chr + "\t" + p);

Java

Java Library Classes

ICSE

35 Likes

Answer

Y       89

Working

Character.toUpperCase()method converts small y to capital Y so chr gets the value of 'Y'. Casting chr to int gives the ASCII code of 'Y' which is 89.

Answered By

22 Likes