java program to know if char is number code example Example: check if char is number java Character.isDigit(str.charAt(i));