Executors.newFixedThreadPool(3).submit(() -> {doSmth();});
"Ambiguous method call. Both submit (Callable) in ExecutorService and submit (Runnable) in ExecutorService match."
How to fix it? I know that I can use anonymous class but I'd like to use Function.
Executors.newFixedThreadPool(3).submit(() -> 1); //Callable
Executors.newFixedThreadPool(3).submit(() -> {doSmth();}); //Runnable
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With