"Missing method body" error
<pre><code>import java.util.Scanner;

public class Rpn_calculator
{
    public static void main(String[] args)
    {
        Scanner keyboard = new Scanner(System.in);


        double ans = 0;
        double n = 0;
        double r = 0;
        String j;


        System.out.println();
        System.out.println();   
        System.out.print("Please enter a value for n  ");
        n = keyboard.nextDouble();  
        System.out.print("Please enter a value for r  ");
        r = keyboard.nextDouble();  
        System.out.println("Please choose one of these operands:+,-,*,nCr,/ to     continue, or q to quit ");
        j = keyboard.nextLine();    
        while (j != "q")
        {
            if(j == "+")
                ans = n + r;
            if(j == "-")
                ans = n - r;
            if(j == "*")
                ans = n * r;
            if(j == "/")
                ans = n / r;
            if(j == "nCr")
                ans = factorial(n + r -1) / (factorial(r)*factorial(n - 1));
            System.out.print(ans);

            System.out.print("Please enter a value for n  ");
            n = keyboard.nextDouble();  
            System.out.print("Please enter a value for r  ");
            r = keyboard.nextDouble();  
            System.out.print("Please choose one of these operands:+,-,*,nCr,/ to continue or q to quit ");
            j = keyboard.nextLine();    
        }   
    }
    public static double factorial(double x);
    {   
        double sum = 1;
        int i; 
        for (i = 0; i&lt;= x; i++);
        sum = sum * i;

        return sum;
    }
} 
</code></pre>

<p>I am trying to create an RPN calculator for this assignment, I believe I have what I need to make it function, but I have syntax errors with my factorial function. It says "missing method body".</p>

<p>Also, I don't understand why, when I compile it, my string input request is ignored completely - locking the program in the <code>while</code> loop. I hope I'm not missing something really obvious.</p>
