0

I have an error like this when I call one function inside another in Java.

Exception in thread "main" java.lang.Error: Unresolved compilation problem: The local variable n may not have been initialized

Here is my code:

public class SecondPart {
public static double Factr(double n){
    int i,fact=1;
    for(i=1;i<=n;i++){      
    return fact=fact*i;
    }
}       

public static double ArcSinh(double x){
    double n;

        return Factr(n);

}
public static void main(String[] args){
    System.out.print(ArcSinh(6.0));

    }

 }

0 Answers0