is it possible to get the length of an integer? i have tried converting an integer to a
string, then getting the length of that variable. but, it seems to be returning only the literal value of the variable.
here is my code:
// create months variable
int months = 3456;
// make String copy of months variable
String cp_months = Integer.toString(months);
// print length of cp_months
System.out.print("\nLength is " + cp_months.length);
this is boggling me. i looked at the String and Integer classes in the API, don't see anything that deals with getting the length of anything but an array.