Give the output of the following Character class methods:

ICSE Class 10 Computer Applications PYQ · 2023 Paper · Section A

2(iv)1 Mark · 2023 · Section A · 2023 Paper

Give the output of the following Character class methods:

(a) Character.toUpperCase ('a')

(b) Character.isLetterOrDigit('#')

Show SolutionHide Solution↓

(a) Character.toUpperCase ('a')

A

In Java, the Character.toUpperCase(char ch) method is used to convert a given character to its uppercase equivalent, if one exists. So, the output is uppercase 'A'.

(b) Character.isLetterOrDigit('#')

false

Character.isLetterOrDigit() method returns true if the given character is a letter or digit, else returns false. Since, hash (#) is neither letter nor digit, the method returns false.

← Previous questionNext question →

Browse the free Computer Applications sample bank