Something like this? Here's the Fibonacci generating part. I haven't quite figured out a good way to keep main from accessing the array too soon, so I put in a little sleep statement in the constructor. I also implemented a dynamic programming solution to finding fibonacci numbers rather than the simple recursive solution (many times faster). I've left the stuff out that you had for what number to calculate the fibonacci number of, but I'm sure you can figure that stuff out (hint: you have it right in your code).
public class Fibonacci implements Runnable
{
int[] fib;
public static void main(String[] args)
{
int[] answers = new Fibonacci(10).getFib();
System.out.println(answer[9]);
}
public Fibonacci(int num)
{
this.fib = new int[num];
new Thread(this).start();
try
{
Thread.sleep(1);
}
catch (InterruptedException exception)
{}
}
public void run()
{
synchronized (this.fib)
{
this.fib[0] = 1;
this.fib[1] = 1;
for (int i = 2; i < this.fib.length; i++)
{
this.fib[i] = this.fib[i - 1] + this.fib[i - 2];
}
}
}
public int[] getFib()
{
return this.fib;
}
}