Must qualify the allocation with an enclosing instance of type GeoLocation

This error happens because you’re trying to create an instance of an inner class service.submit(new ThreadTask(i)); without creating instance of main class..

To resolve this issue please create instance of main class first:

GeoLocation outer = new GeoLocation();

Then create instance of class you intended to call, as follows:

service.submit(outer.new ThreadTask(i));

Leave a Comment