num is an int, which is a primitive data type, not an array, so you can't check its length property because primitive data types don't have a length property.
If num were an array, you would only determine how many elements were in the array, not how many characters were in any of the array elements. But, an int doesn't work like a string -- it doesn't have a number of characters. If you have the user enter a number as a String, then you could use the length method of the String class to get the number of characters the user entered, in this case the number of digits in the number.
Give a man a fish, he'll eat for one day. Teach a man to fish, he'll drink all your beer.
Cheers, Jeff (SCJP 1.4, SCJD in progress, if you can call that progress...)
Like mentioned before if the users entered them as a string then the .length() method works nicely. Or a recursive method can also work like below. Cheers,
[ removed a recursive solution that used repeated division by ten, until no number greater than 9 was left, counting once for each division, plus once for any remaining digit -ds ] [ October 26, 2004: Message edited by: Dirk Schreckmann ]