how to check whether the character is digit or not in java code example Example: check if char is number java Character.isDigit(str.charAt(i));