Java find the number of digits in a number

Java find the number of digits in a number
/**
 * @author lautturi.com 
 * Java example: java get the number of digits in a Integer 
 * count the digits of number in java
 */

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.*;

public class Lautturi {
	public static void main(String args[]) {
		int count = 0;
		int num = 1234567;
		while (num > 0) {
			num /= 10;
			count++;
		}
		System.out.println("the number of digits: " + count);
	}
}
Source:‮.www‬lautturi.com

output:

the number of digits: 7
Created Time:2017-10-05 13:18:16  Author:lautturi