Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to get length of integer in java

int length = 0;
long temp = 1;
while (temp <= number) {
    length++;
    temp *= 10;
}
return length;
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #length #integer #java
ADD COMMENT
Topic
Name
3+8 =