Justin SmithLevel 41, Greenfield, USA, United States
2 May 2022
They have the difficulties backwards on this set of tasks. The first two are easy (they literally tell you every step of the process). The last one is hard. I've been googling for a bit and I still have no idea how to even approach this. I thought maybe enclosing the method call in a try/catch with InterruptedException but it just says that it never throws that type of exception. I tried putting the Runnable objects in an arraylist so that i could iterate through them after the shutdownnow method to find out which ones were interrupted, but that's not working either.
I was thinking where are the rest of the threads? Is my computer so fast that is executes all of them before it has time to call the shutdown method? 😂
GO TO FULL VERSION