February 2014
Beginner
1248 pages
62h 25m
English
• A Runnable (p. 963) object represents a task that can execute concurrently with other tasks.
• Interface Runnable declares method run (p. 963) in which you place the code that defines the task to perform. The thread executing a Runnable calls method run to perform the task.
• A program will not terminate until its last thread completes execution.
• You cannot predict the order in which threads will be scheduled, even if you know the order in which they were created and started.
• It’s recommended that you use the Executor interface (p. 963) to manage the execution of Runnable objects. An Executor object typically creates and manages a group of threads—called a thread pool ...
Read now
Unlock full access