KnowledgeBoat Logo

Computer Applications

State the data type after the following is executed :

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

Java Library Classes

3 Likes

Answer

boolean

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

Answered By

2 Likes


Related Questions