public class IsDigit { public static void main(String[] args) { char c; c = 52; System.out.println(c); c = '4'; // Change this and demo if ( 48 <= c && c <= 57 ) System.out.println("Digit symbol"); else System.out.println("Not a digit symbol"); if ( '0' <= c && c <= '9' ) System.out.println("Digit symbol"); else System.out.println("Not a digit symbol"); if ( Character.isDigit(c) ) System.out.println("Digit symbol"); else System.out.println("Not a digit symbol"); } }