 <p>if a field is final, then you have to initialize it when it's declared or with a constructor:</p> <pre><code> private final int N =10; private PrimeBuggy(int threadNum) { start = N/numThreads * threadNum; this.threadNum = threadNum; } </code></pre> <p>Nevertheless, you have in your code several initialization in a methid:</p> <pre><code> start = N/numThreads * threadNum; N = start + N/numThreads; </code></pre> <p>and this makes no sense at all:</p> <pre><code> //I created a lock private Lock lock(); this.start = start; this.N = N; </code></pre>