#Why am i getting an error message?

17 messages · Page 1 of 1 (latest)

winter monolith
#
public class fractal{
    
    static int factorial(int n){
        if(n==1 || n==0){
            return 1;
        } else {
            return n*factorial(n-1);
        }
        
    }
    
    public static void main(String[] args){
        System.out.println(factorial(5));

    }
}

Exception in thread "main" java.lang.Error: Unresolved compilation problem:

    at fractal.main(fractal1.java:12)

^^ This is the error message

lofty echoBOT
#

Hey, @winter monolith!
Please remember to /close this post once your question has been answered!

deep lynx
steel stag
#

thats fine

deep lynx
#

even in this case?

steel stag
#

yes

deep lynx
#

ugh my brain bad

steel stag
deep lynx
#

im new to java

winter monolith
#

it's fine it works now i just had to reload the compiler

#

thanks guys

deep lynx
#

o

#

do /close

#

@winter monolith