len of a long in java code example
Example 1: how to get length of integer in java
int length = (int) (Math.log10(number) + 1);
Example 2: len of number in java
Scanner s = new Scanner(System.in);
int n = s.nextInt();
int length = String.valueOf(n).length();
System.out.print(length);