Threads and concurrency
Thread:
- Sequence of executing statements that can be running concurrently with other threads
To create a thread in Java:
- 1. Create a class implementing Runnable or extending Thread
- 2. Implement the run method as a loop that does something for a period of time
- 3. Create an instance of this class
- 4. Invoke the start operation, which calls run