O'Reilly logo

Java™ Network Programming and Distributed Computing by Michael Reilly, David Reilly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.2. Multi-threading in Java

Java, like many modern programming languages, includes support for multi-threaded applications. In Java, threads of execution are represented by the java. lang.Thread class, while code for tasks that are designed to run in a separate thread is represented by the java.lang.Runnable interface. It is very important that developers be aware of both.

7.2.1. Creating Multi-threaded Applications with the Thread Class

The java.lang.Thread class provides methods to start, suspend, resume, and stop a thread, as well as to control other aspects such as the priority of a thread or the name associated with it. The simplest way to use the Thread class is to extend it and override the run() method, which is invoked when the thread ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required