Runnable task = () -> System.out.println("Hello world!"); executor.schedule(task, 10, TimeUnit.SECONDS); System.out.println("Done!");
The output is:
That is we schedule the task, then print “Done!”. 10 seconds later the scheduled task executes and prints “Hello world!”.
But what happens if the
Runnable throws an