English

Write the output of the following. boolean b1 = Character.isDigit('h'); System.out.println(b1);

Advertisements
Advertisements

Question

Write the output of the following.

boolean b1 = Character.isDigit('h');

System.out.println(b1);

Very Short Answer
Advertisements

Solution

false

Explanation:

The method Character.isDigit('h') checks whether the character inside the parentheses is a numeric digit (0–9). Because it 'h' is a lowercase letter and not a number, the method evaluates to it, which is then stored in b1 and printed.

shaalaa.com
  Is there an error in this question or solution?
Chapter 5: Library Classes - Exercises [Page 135]

APPEARS IN

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

Englishहिंदीमराठी


      Forgot password?
Use app×