ICSE Class 10 Computer Applications Question 20 of 30

Solved Sample Paper 4 — Question 20

Back to all questions
20
Question

Question 1(xx)

State the data type after the following is executed :

char ch = '9';
res = Character.isDigit(ch);
  1. int
  2. char
  3. string
  4. boolean
Answer

boolean

Reason — isDigit() method returns true if the specified character is a digit; returns false otherwise. Thus, the return type is boolean.