##### What is Factorial ?

In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n. For example, the factorial of 5 (written as 5!) is 5 * 4 * 3 * 2 * 1 = 120. The factorial of 0 (written as 0!) is defined to be 1.

Factorials have a number of interesting properties and appear in various areas of mathematics and physics. They are often used to count the number of ways that a certain event can occur, or to compute the number of permutations or combinations of a set of objects. For example, the number of ways that a group of people can sit in a circle is equal to the factorial of the number of people in the group.

Factorials can be computed using a variety of methods, including recursion, iteration, and using the Gamma function. In many programming languages, it is possible to compute factorials using a simple loop or recursive function.

Here is a simple Java program that calculates the factorial of a number:

**
import java.util.Scanner;
public class Factorial {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter a number: ");
int number = scanner.nextInt();
int factorial = 1;
for (int i = 1; i <= number; i++) {
factorial *= i;
}
System.out.println("The factorial of " + number + " is " + factorial);
}
}**

This program prompts the user to enter a number, reads it from the standard input, and calculates the factorial of the number using a simple loop. The result is then printed to the standard output.