English

Return data type of isDigit(char ch) is:

Advertisements
Advertisements

Question

Return data type of isDigit(char ch) is:

Options

  • char

  • boolean

  • Boolean

  • bool

MCQ
Advertisements

Solution

boolean

Explanation:

  • Purpose: The Character.isDigit(char ch) method in Java checks whether a character is a numeric digit (0-9).
  • Return Value: Since the check can only result in a true or false outcome, it returns a primitive boolean value.
  • Language Rule: Java uses lowercase boolean for this primitive type, unlike bool in C++ or the Boolean wrapper class object.
shaalaa.com
  Is there an error in this question or solution?
Chapter 5: Library Classes - Exercises [Page 133]

APPEARS IN

Rupa Pandit Computer Applications [English] Class 10 ICSE
Chapter 5 Library Classes
Exercises | Q 1. (i) | Page 133
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×