tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 
 Java > Core > Character > Is Digit

Is Digit 

The following example shows how to use Character.isDigit() API.

File Name  :  
com/bethecoder/tutorials/core/character/CharIsDigit.java 
Author  :  Sudhakar KV
Email  :  kvenkatasudhakar@gmail.com
   
package com.bethecoder.tutorials.core.character;

public class CharIsDigit {

  /**
   @param args
   */
  public static void main(String[] args) {
    System.out.println(Character.isDigit('a'));
    System.out.println(Character.isDigit('\n'));
    System.out.println(Character.isDigit('\t'));
    
    System.out.println(Character.isDigit('7'));
    System.out.println(Character.isDigit('8'));
    System.out.println(Character.isDigit('6'));
  }

}
   

It gives the following output,
false
false
false

true
true
true


                    Print

   



Books Recommendation

 
 
bl  br