The article directories
- One, foreword
- Second, the first understanding of multithreading
-
- 2.1 Introduction: Xiao Ming is playing games while listening to music
- 2.2 Two ways to implement multithreading
-
- 2.2.1 Inheriting Thread class: Extension – Xiao Ming plays games while listening to music, and chats with Xiao Qiang through QQ
- 2.2.2 Implementing the Runnable Interface
- 2.3 Two Ways to Implement Multithreading (Anonymous)
-
- 2.3.1 Inheriting Thread (Anonymous Inner Class)
- 2.3.2 Implementing the Runnable Interface (Anonymous Inner Class)
- 2.4 summary
- Third, thread synchronization
-
- 3.1 Introduction: Three people eat apples
-
- 3.1.1 Inheritance of Thread class: Three people eating apples problem
- 3.1.2 Implementation of Runnable Interface: Three People eating apples problem
- 3.1.3 Plus Thread.sleep(milliseconds