Having errors with Java assignment
<p>I'm getting some errors in code I wrote for an assignment, and I can't quite understand them.</p>

<pre><code>I:\Java Programming\FibonacciJDialog.java:19: error: variable sum might not have been initialized
        return sum;
               ^
I:\Java Programming\FibonacciJDialog.java:20: error: unreachable statement
        JOptionPane.showMessageDialog(null,"That Fibonacci Number is" ); // Display results in dialog box.
        ^
I:\Java Programming\FibonacciJDialog.java:25: error: missing return statement
    }
    ^
3 errors
Tool completed with exit code 1
</code></pre>

<p>Here is the code:</p>

<pre><code>import javax.swing.JOptionPane;

public class FibonacciJDialog {

    public static long main(String[] args) {
        String num;
        int n;
        int sum;

        num = JOptionPane.showInputDialog("Enter n: "); // getting user number input.
        n = Integer.parseInt(num);

        Fibonacci box = new Fibonacci(); // Creating new Fibonacci object.

        JOptionPane.showMessageDialog(null, "That Fibonacci Number is"); // Display results in dialog box.
        return sum;

        System.exit(0); // Terminate

    }
}
</code></pre>

<p>This is the Fibonacci class I made.</p>

<pre><code>public class Fibonacci {
    int Fib(int n) {
        int in1 = 1, in2 = 1;
        int sum = 0;//initial value
        int index = 1;
        while (index &lt; n) {
            // sum=the sum of 2 values;
            // in1 gets in2
            // in2 gets sum
            // increment index
        }
        return sum;
    }
}
</code></pre>
