Hi, im new to this forum and also Java. Im currrently doing my degree 1st year. My lecturer gave me a question on factorial and im unable to solve it.
i need to explain why any number of threads can be executing inside of it without causing interference in the program below.
Public int factorial (int n)
{
If (n<0)
Return -1;
Else if (n ==0)
Return 1;
Int result =1;
For (i=1; i<=n;i++)
{
Int tem = result;
Temp= temp *I;
Result=temp
}
Return result;
}
Please help me to understand this and what should i do to complete it