Java - isDigit() Method


Advertisements

Description

The method determines whether the specified char value is a digit.

Syntax

boolean isDigit(char ch)

Parameters

Here is the detail of parameters −

  • ch − Primitive character type.

Return Value

  • This method returns true, if the passed character is really a digit.

Example

public class Test {

   public static void main(String args[]) {
      System.out.println(Character.isDigit('c'));
      System.out.println(Character.isDigit('5'));
   }
}

This will produce the following result −

Output

false
true
java_characters.htm

Useful Video Courses


Video

Java Date and Time Online Training

16 Lectures 2 hours

Malhar Lathkar

Video

Java Servlet Online Training

19 Lectures 5 hours

Malhar Lathkar

Video

JavaScript Online Training

25 Lectures 2.5 hours

Anadi Sharma

Video

Java Online Training

Most Popular

126 Lectures 7 hours

Tushar Kale

Video

Java Essential Training

119 Lectures 17.5 hours

Monica Mittal

Video

Java Essentials Online Training

76 Lectures 7 hours

Arnab Chakraborty

Advertisements