no String API, no utils, no type conversion, just pure java iteration ->
public static int getNumberOfDigits(int input) { int numOfDigitnumOfDigits = 1; int base = 1; while (input >= base * 10) { base = base * 10; numOfDigit++;numOfDigits++; } return numOfDigit;numOfDigits; } You can go long for bigger values if you please.