java calculate the product 1 to n

https://w‮l.ww‬autturi.com
java calculate the product 1 to n
/**
 * @author lautturi.com 
 * Java example: calculate the product of 1 to n in java
 */

import java.util.*;

public class Lautturi {

	public static void main(String[] args) {

		int n = 10;
		int product = 1;
	    for (int i = 2; i <= n; ++i) {
	      product *= i;
	    }
	    System.out.println("The product of 1..n is " + product);
	}
}

output:

The product of 1..n is 3628800
Created Time:2017-09-27 21:03:00  Author:lautturi