Programs run from start to finish, executing a single thread of control.
Tasks are performed in linear sessions, where one task must wait for another task to be completed before it can have its turn. This is the schematic of a single-threaded program. Naturally, multithreading is the execution of several threads at the same time where each task is performed in parallel with other tasks. Each thread receives a priority value and is allocated a certain amount of system time or attention based on this. Threads apply well to Java because each applet can run in its own thread without interferring with or hogging system resources.