
please tell me, how to write program on factorial of a given number in java?

hi friend,
You can write a program for getting the factorial of a given number as follows
class Factorial
{
public static void main(String[] args)
{
int a= 5;
int fact= 1;
System.out.print("Factorial of " +a+ " = ");
int i = 1;
while(i <= 5)
{
fact = fact*i;
i++;
}
System.out.println(fact);
}
}
For detail tutorial you can go through the following link Write a program to calculate factorial of any given number