Must qualify the allocation with an enclosing instance of type GeoLocation
<p>I am getting this error as- </p>

<p><strong>No enclosing instance of type GeoLocation is accessible. Must qualify the allocation with an enclosing instance of type GeoLocation (e.g. x.new A() where x is an instance of GeoLocation).</strong> This error is coming on <strong><em>new ThreadTask(i)</em></strong> I don't know why is it happening. Any suggestions will be appreciated.</p>

<pre><code>public class GeoLocation {

        public static void main(String[] args) throws InterruptedException {

            int size = 10;


            // create thread pool with given size
            ExecutorService service = Executors.newFixedThreadPool(size); 

            // queue some tasks
            for(int i = 0; i &lt; 3 * size; i++) {
                service.submit(new ThreadTask(i));
            }


            // wait for termination        
            service.shutdown();
            service.awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS); 

        }

        class ThreadTask implements Runnable {
            private int id;

            public ThreadTask(int id) {
                this.id = id;
            }

            public void run() {
                System.out.println("I am task " + id);




            }
        }
</code></pre>
