char c = '7'; if (Character.isDigit(c)) { System.out.println(c + " is a digit"); } else { System.out.println(c + " is not a digit"); }
char c = '3'; int num = Character.getNumericValue(c); System.out.println("The numeric value of " + c + " is " + num);Output: The numeric value of 3 is 3 The Character class is part of the java.lang package library.