how to check if an scanner value is an integer code example Example: scanner check if int boolean isAnInt = scanner.hasNextInt();