Thread.sleep inside infinite while loop in lambda doesn’t require ‘catch (InterruptedException)’ – why not?
The reason for this, is that these invocations are in fact, invocations to two different overloaded methods available in ExecutorService; each of these methods taking a single argument of different types: <T> Future<T> submit(Callable<T> task); 2. Future<?> submit(Runnable task); Then what happens is that the compiler is converting the lambda in the first case of … Read more