© Vaskaran Sarcar 2020
V. SarcarInteractive Object-Oriented Programming in Javahttps://doi.org/10.1007/978-1-4842-5404-2_11

11. Thread Programming

Vaskaran Sarcar1 
(1)
Bangalore, Karnataka, India
 

The Java programs that you have seen so far have had a single sequential flow of control; in other words, once the program starts executing, it goes through all statements sequentially until the end. So, in a particular moment, there is only one statement under execution.

A thread is similar to a program. It has a single flow of control. It also has a body between the starting point and end point, and it executes the commands sequentially. Each program has at least one thread.

Java supports the concept of multi-threading; that is, in Java you can have multiple ...

Get Interactive Object-Oriented Programming in Java: Learn and Test Your Programming Skills now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.