February 2014
Beginner
1248 pages
62h 25m
English
The code in main executes in the main thread, which is created by the JVM. The code in the run method of PrintTask (lines 21–37 of Fig. 23.3) executes whenever the Executor starts each PrintTask—again, this is sometime after they’re passed to the ExecutorService’s execute method (Fig. 23.4, lines 21–23). When main terminates, the program itself continues running because there are still tasks that must finish executing. The program will not terminate until these tasks complete.
Read now
Unlock full access