posted 11 years ago
future.get() method throws java.lang.InterruptedException, java.util.concurrent.ExecutionException which either you need to catch it or add throw for these exception in your main method.
I would suggest to have a look on Future Class APIs to understand its behaviour.
And yes, you need to add shutdown() to end the executor service otherwise it will continue to run indefinitely.
Thanks